-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move esbuild configuration to
build.mjs
.
In preparation for Surfer webview integration.
- Loading branch information
1 parent
0b783ff
commit fce5805
Showing
2 changed files
with
32 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import * as esbuild from 'esbuild'; | ||
|
||
const mode = (process.argv[2] ?? 'build'); | ||
|
||
const commonOptions = { | ||
logLevel: 'info', | ||
bundle: true, | ||
target: 'es2021', | ||
sourcemap: 'linked', | ||
outdir: 'out/', | ||
}; | ||
|
||
const extensionContext = await esbuild.context({ | ||
external: ['vscode'], | ||
format: 'cjs', | ||
platform: 'node', | ||
entryPoints: { | ||
'extension': './src/extension.ts', | ||
}, | ||
...commonOptions | ||
}); | ||
|
||
if (mode === 'build') { | ||
await extensionContext.rebuild(); | ||
await extensionContext.dispose(); | ||
} else if (mode === 'watch') { | ||
await extensionContext.watch(); | ||
} else { | ||
console.error(`Usage: ${process.argv0} [build|watch]`); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters