This repository has been archived by the owner on Jun 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update esbuild and make the watcher work without triggering a warning…
… prompt. - onCommand:extension.insertColonOrSemiColon is no longer needed to be displayed as VS Code now knows which commands we have.
- Loading branch information
1 parent
8c7a6fb
commit 52e29eb
Showing
8 changed files
with
659 additions
and
633 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
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 |
---|---|---|
|
@@ -7,4 +7,4 @@ src/** | |
.github/** | ||
.nvmrc | ||
.editorConfig | ||
build.js | ||
build.mjs |
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
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
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,40 @@ | ||
import esbuild from "esbuild"; | ||
|
||
const production = process.argv[2] === "--production"; | ||
const watch = process.argv[2] === "--watch"; | ||
const context = await esbuild | ||
.context({ | ||
entryPoints: ["./src/extension.ts"], | ||
bundle: true, | ||
outdir: "dist", | ||
external: ["vscode"], | ||
format: "cjs", | ||
sourcemap: !production, | ||
minify: production, | ||
platform: "node", | ||
target: "ES2022", | ||
plugins: [ | ||
{ | ||
name: "watch", | ||
setup(build) { | ||
build.onEnd(() => { | ||
if (watch) console.log("build finished"); | ||
}); | ||
build.onStart(() => { | ||
if (watch) console.log("building..."); | ||
}); | ||
}, | ||
}, | ||
], | ||
}) | ||
.catch((e) => { | ||
console.error(e); | ||
process.exit(1); | ||
}); | ||
|
||
if (watch) { | ||
await context.watch(); | ||
} else { | ||
context.rebuild(); | ||
context.dispose(); | ||
} |
Oops, something went wrong.