Skip to content

Commit 2ee7a3f

Browse files
committed
feat: add esbuild bundling
1 parent b1e76ed commit 2ee7a3f

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

package.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@
9292
"@types/vscode": "*",
9393
"@typescript-eslint/eslint-plugin": "^4.26.0",
9494
"@typescript-eslint/parser": "^4.26.1",
95+
"esbuild": "^0.12.21",
9596
"eslint": "^7.21.0",
9697
"eslint-config-prettier": "^8.1.0",
9798
"husky": "^7.0.0",
@@ -105,8 +106,9 @@
105106
},
106107
"scripts": {
107108
"prebuild": "js-yaml syntaxes/nix.YAML-tmLanguage > syntaxes/nix.tmLanguage.json && js-yaml syntaxes/injection.yml > syntaxes/injection.json",
108-
"build": "tsc -p ./",
109-
"watch": "yarn build --watch",
109+
"build-base": "esbuild ./src/extension.ts --bundle --outfile=dist/extension.js --external:vscode --format=cjs --platform=node",
110+
"build": "yarn run build-base -- --sourcemap --minify",
111+
"watch": "yarn run build-base -- --sourcemap --watch",
110112
"postinstall": "husky install",
111113
"release": "yarn install && yarn lint && yarn build && standard-version && git push --follow-tags && yarn run publish",
112114
"package": "vsce package",

tsconfig.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"compilerOptions": {
33
"module": "commonjs",
4-
"target": "es6",
4+
"target": "es2018",
55
"outDir": "dist",
66
"lib": [
7-
"es6"
7+
"es2018"
88
],
99
"sourceMap": true,
1010
"rootDir": "src",

yarn.lock

+5
Original file line numberDiff line numberDiff line change
@@ -1083,6 +1083,11 @@ error-ex@^1.3.1:
10831083
dependencies:
10841084
is-arrayish "^0.2.1"
10851085

1086+
esbuild@^0.12.21:
1087+
version "0.12.21"
1088+
resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.12.21.tgz#7ff32a9ac73ce4310f9cb61ea4c3da9756570d46"
1089+
integrity sha512-7hyXbU3g94aREufI/5nls7Xcc+RGQeZWZApm6hoBaFvt2BPtpT4TjFMQ9Tb1jU8XyBGz00ShmiyflCogphMHFQ==
1090+
10861091
escalade@^3.1.1:
10871092
version "3.1.1"
10881093
resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40"

0 commit comments

Comments
 (0)