给出一个VSCode task.json文件,其构建任务配置如下:
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"type": "typescript",
"label": "build",
"tsconfig": "tsconfig.json",
"problemMatcher": [
"$tsc"
],
"group": {
"kind": "build",
"isDefault": true
}
}
] }
作为上述构建任务的一部分,有什么方法可以运行Shell脚本吗?具体来说,我想运行在package.json
中定义的 npm run myTask{
"name": "my_Awesome_App",
"productName": "My Awesome App",
"version": "1.0.0",
"description": "My Awesome App",
"scripts": {
"myTask": "echo Hello World!" // obviously this Is not my real task ;)
},
我对NPM和Visual Studio代码还很陌生,所以不确定是否有办法做到这一点或什么是最佳实践。我试图实现的目标等同于Visual Studio中的预构建或预构建事件。