Skip to content

Commit

Permalink
fix: web bundle lead to package size greatly increased
Browse files Browse the repository at this point in the history
close #1084
  • Loading branch information
johnsoncodehk committed Apr 3, 2022
1 parent d567b3c commit 9ec1923
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 12 deletions.
14 changes: 9 additions & 5 deletions extensions/vscode-vue-language-features/package.json
Expand Up @@ -13,7 +13,7 @@
"author": "johnsoncodehk",
"publisher": "johnsoncodehk",
"engines": {
"vscode": "^1.61.0"
"vscode": "^1.63.0"
},
"keywords": [
"volar",
Expand Down Expand Up @@ -635,17 +635,21 @@
}
},
"scripts": {
"vscode:prepublish": "npm run build",
"prebuild": "cd ../.. && npm run build",
"build": "npm run build:node && npm run build:browser",
"watch": "npm run build:node -- --watch & npm run build:browser -- --watch",
"build:node": "node scripts/build-node",
"build:browser": "node scripts/build-browser",
"pack": "vsce package",
"release": "vsce publish"
"prepack:node": "npm run prebuild && npm run build:node -- --minify && npm run build:browser -- --empty",
"prepack:browser": "npm run prebuild && npm run build:browser -- --minify && npm run build:node -- --empty",
"pack:node": "npm run prepack:node && vsce package",
"pack:browser": "npm run prepack:browser && vsce package",
"release:node": "npm run prepack:node && vsce publish --target win32-x64 win32-ia32 win32-arm64 linux-x64 linux-arm64 linux-armhf darwin-x64 darwin-arm64 alpine-x64 alpine-arm64",
"release:browser": "npm run prepack:browser && vsce publish --target web",
"release": "npm run release:node && npm run release:browser"
},
"devDependencies": {
"@types/vscode": "1.61.0",
"@types/vscode": "1.63.0",
"@types/ws": "^8.5.3",
"@volar/shared": "0.33.9",
"@volar/vue-language-server": "0.33.9",
Expand Down
@@ -1,5 +1,7 @@
require('esbuild').build({
entryPoints: {
entryPoints: process.argv.includes('--empty') ? {
client: './scripts/empty.js',
} : {
client: './out/browserClientMain.js',
},
bundle: true,
Expand Down Expand Up @@ -34,7 +36,9 @@ require('esbuild').build({
}).catch(() => process.exit(1))

require('esbuild').build({
entryPoints: {
entryPoints: process.argv.includes('--empty') ? {
server: './scripts/empty.js',
} : {
server: './node_modules/@volar/vue-language-server/out/browser.js',
},
bundle: true,
Expand Down
@@ -1,5 +1,8 @@
require('esbuild').build({
entryPoints: {
entryPoints: process.argv.includes('--empty') ? {
client: './scripts/empty.js',
server: './scripts/empty.js',
} : {
client: './out/nodeClientMain.js',
server: './node_modules/@volar/vue-language-server/out/node.js',
},
Expand Down
1 change: 1 addition & 0 deletions extensions/vscode-vue-language-features/scripts/empty.js
@@ -0,0 +1 @@
export { };
8 changes: 4 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9ec1923

Please sign in to comment.