Skip to content

Commit 4a85531

Browse files
Fix the issue that npm preLaunchTask does not exit (microsoft#519)
Signed-off-by: Jinbo Wang <[email protected]>
1 parent 66e671f commit 4a85531

3 files changed

Lines changed: 18 additions & 26 deletions

File tree

‎.vscode/launch.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"stopOnEntry": false,
1212
"sourceMaps": true,
1313
"outFiles": [ "${workspaceRoot}/out/src/**/*.js" ],
14-
"preLaunchTask": "npm"
14+
"preLaunchTask": "npm: watch"
1515
},
1616
{
1717
"name": "Launch Tests",
@@ -22,7 +22,7 @@
2222
"stopOnEntry": false,
2323
"sourceMaps": true,
2424
"outFiles": [ "${workspaceRoot}/out/test/**/*.js" ],
25-
"preLaunchTask": "npm"
25+
"preLaunchTask": "npm: watch"
2626
}
2727
]
2828
}

‎.vscode/tasks.json‎

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,19 @@
99
// A task runner that calls a custom npm script that compiles the extension.
1010
{
1111
"version": "2.0.0",
12-
13-
// we want to run npm
14-
"command": "npm",
15-
16-
// the command is a shell script
17-
"type": "shell",
18-
19-
// show the output window only if unrecognized errors occur.
20-
"presentation": {
21-
"echo": true,
22-
"reveal": "silent",
23-
"focus": false,
24-
"panel": "shared"
25-
},
26-
27-
// we run the custom script "compile" as defined in package.json
28-
"args": ["run", "compile", "--loglevel", "silent"],
29-
30-
// The tsc compiler is started in watching mode
31-
"isBackground": true,
32-
33-
// use the standard tsc in watch mode problem matcher to find compile problems in the output.
34-
"problemMatcher": "$tsc-watch"
12+
"tasks": [
13+
{
14+
"type": "npm",
15+
"script": "watch",
16+
"problemMatcher": "$tsc-watch",
17+
"isBackground": true,
18+
"presentation": {
19+
"reveal": "never"
20+
},
21+
"group": {
22+
"kind": "build",
23+
"isDefault": true
24+
}
25+
}
26+
]
3527
}

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@
407407
},
408408
"scripts": {
409409
"vscode:prepublish": "tsc -p ./",
410-
"compile": "tsc -watch -p ./",
410+
"watch": "tsc -watch -p ./",
411411
"postinstall": "node ./node_modules/vscode/bin/install",
412412
"test": "node ./scripts/download-vscode-for-system-tests && node ./scripts/install-vsix-dependencies redhat.java && node ./scripts/install-vsix-dependencies vscode-java-debug-0.16.0.vsix && node ./scripts/run-vscode-tests"
413413
},

0 commit comments

Comments
 (0)