Skip to content

Commit

Permalink
Fix vscode debugger
Browse files Browse the repository at this point in the history
  • Loading branch information
yoyo930021 committed Oct 9, 2020
1 parent 07eb856 commit 2dd9fa8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
"protocol": "inspector",
"restart": true,
"smartStep": true,
"sourceMapPathOverrides": {
"server/*": "${workspaceRoot}/server/*",
},
"skipFiles": ["<node_internals>/**"]
},
{
Expand Down
8 changes: 7 additions & 1 deletion build/rollup-plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,13 @@ function bundleVlsWithEsbuild() {
// watch src changed
this.addWatchFile(getServerURL('src/'));

if (!service) service = await startService();
if (!service) {
// hack with esbuild and vscode debugger
const oldCwd = process.cwd;
process.cwd = () => getServerURL('../');
service = await startService();
process.cwd = oldCwd;
}
console.log(`bundles ${getServerURL('src/main.ts')} with esbuild`);
await service.build({
entryPoints: [getServerURL('src/main.ts')],
Expand Down

0 comments on commit 2dd9fa8

Please sign in to comment.