Skip to content

Commit bcba187

Browse files
authored
Merge pull request #712 from KxSystems/ee-watch
Enhance watching
2 parents b01100e + ae6f8ce commit bcba187

File tree

4 files changed

+145
-111
lines changed

4 files changed

+145
-111
lines changed

.vscode/tasks.json

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,8 @@
88
"isBackground": true,
99
"label": "npm: watch",
1010
"problemMatcher": {
11-
"owner": "typescript",
12-
"source": "ts",
13-
"applyTo": "closedDocuments",
14-
"fileLocation": ["relative", "${cwd}"],
15-
"pattern": {
16-
"regexp": "^Error: Build failed[^:]*:([^:]*):([^:]*):([^:]*): (ERROR:.*)$",
17-
"file": 1,
18-
"line": 2,
19-
"column": 3,
20-
"message": 4
21-
},
11+
"base": "$eslint-stylish",
2212
"background": {
23-
"activeOnStart": true,
2413
"beginsPattern": {
2514
"regexp": "^esbuild:started$"
2615
},

esbuild.mjs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,20 @@ const webviewConfig = {
6161
context(webviewConfig),
6262
context(extensionConfig),
6363
]);
64-
await Promise.all(contexts.map((ctx) => ctx.rebuild()));
65-
contexts.forEach((ctx) => ctx.watch({ delay: 500 }));
66-
console.log("esbuild:watching");
64+
await Promise.all(contexts.map((ctx) => ctx.rebuild())).finally(() =>
65+
Promise.all(contexts.map((ctx) => ctx.watch({ delay: 500 })))
66+
.then(() => console.log("esbuild:watching"))
67+
.catch((err) => {
68+
console.error(err);
69+
process.exit(1);
70+
}),
71+
);
6772
} else {
6873
await build(serverConfig);
6974
await build(webviewConfig);
7075
await build(extensionConfig);
7176
}
7277
} catch (err) {
7378
console.error(err);
74-
process.exit(1);
7579
}
7680
})();

0 commit comments

Comments
 (0)