Skip to content

Commit 9b12899

Browse files
committed
package: add new npm scripts, use esbuild to minify
This adjusts the build scripts to add the new scripts required to build. The new additions are: - esbuild-base: the core esbuild command for bundling the extension - esbuild-watch: the watch version used for development - package: package only step - dev-package: package the extension with the development version id This updates the `vscode:prepublish` script to minify the extension prior to building the extension package. `createDevPackage` is left as a compatibility option, however, it does not work on all platforms (i.e. Windows) due to the use of bash specific scripting.
1 parent b291886 commit 9b12899

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

Editors/vscode/package.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,14 @@
1919
"onLanguage:objective-c",
2020
"onLanguage:objective-cpp"
2121
],
22-
"main": "./out/extension",
22+
"main": "./out/main",
2323
"scripts": {
24-
"vscode:prepublish": "npm run compile",
25-
"compile": "tsc -p ./",
26-
"watch": "tsc -watch -p ./",
24+
"vscode:prepublish": "npm run -S esbuild-base -- --minify",
25+
"esbuild-base": "esbuild ./src/extension.ts --bundle --outfile=out/main.js --external:vscode --format=cjs --platform=node",
26+
"esbuild": "npm run -S esbuild-base -- --sourcemap",
27+
"esbuild-watch": "npm run -S esbuild-base -- --sourcemap --watch",
28+
"package": "vsce package",
29+
"dev-package": "vsce package -o sourcekit-lsp-development.vsix",
2730
"createDevPackage": "npm install && ./node_modules/.bin/vsce package -o ./out/sourcekit-lsp-vscode-dev.vsix"
2831
},
2932
"dependencies": {

0 commit comments

Comments
 (0)