Skip to content

Commit

Permalink
Update rollup and esbuild
Browse files Browse the repository at this point in the history
  • Loading branch information
yoyo930021 committed Feb 18, 2023
1 parent 68ab78e commit 18b4322
Show file tree
Hide file tree
Showing 7 changed files with 174 additions and 160 deletions.
22 changes: 18 additions & 4 deletions build/rollup-plugins.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { build } = require('esbuild');
const esbuild = require('esbuild');
const path = require('path');
const { spawn } = require('child_process');

Expand Down Expand Up @@ -110,16 +110,30 @@ function bundleVlsWithEsbuild() {
],
format: 'cjs',
tsconfig: getServerPath('tsconfig.json'),
color: true,
incremental: !!process.env.ROLLUP_WATCH
color: true
};

let context = null;
const build = async () => {
if (!!process.env.ROLLUP_WATCH) {
await esbuild.build(options);
} else {
if (!context) {
context = await esbuild.context(options);
}
await context.watch();
}
};

return {
name: 'bundle-vls-with-esbuild',
async buildStart() {
console.log(`bundles ${getServerPath('src/main.ts')} with esbuild`);
build(options);
await build(options);
console.log(`✨ success with esbuild`);
},
async buildEnd() {
context?.dispose();
}
};
}
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@
]
},
"devDependencies": {
"@rollup/plugin-commonjs": "^24.0.0",
"@rollup/plugin-commonjs": "^24.0.1",
"@rollup/plugin-json": "^6.0.0",
"@rollup/plugin-node-resolve": "^15.0.1",
"@types/glob": "^8.0.1",
Expand All @@ -609,7 +609,7 @@
"@types/shelljs": "^0.8.9",
"@types/vscode": "^1.52.0",
"@vscode/test-electron": "2.2.3",
"esbuild": "^0.16.10",
"esbuild": "^0.17.8",
"fs-extra": "^11.1.0",
"glob": "^8.1.0",
"husky": "^8.0.3",
Expand All @@ -619,7 +619,7 @@
"mocha": "^10.2.0",
"npm-run-all": "^4.1.5",
"prettier": "^2.8.4",
"rollup": "^3.9.0",
"rollup": "^3.17.0",
"rollup-plugin-delete": "^2.0.0",
"rollup-plugin-dts": "^5.2.0",
"rollup-plugin-terser": "^7.0.2",
Expand Down
2 changes: 1 addition & 1 deletion server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"parse-gitignore": "^2.0.0",
"prettier-eslint": "^13.0.0",
"prettier-tslint": "^0.4.2",
"rollup": "^3.6.0",
"rollup": "^3.17.0",
"sass-formatter": "^0.7.6",
"source-map-support": "^0.5.20",
"stylus": "^0.59.0",
Expand Down
8 changes: 4 additions & 4 deletions server/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3888,10 +3888,10 @@ rimraf@^3.0.0, rimraf@^3.0.2:
dependencies:
glob "^7.1.3"

rollup@^3.6.0:
version "3.6.0"
resolved "https://registry.yarnpkg.com/rollup/-/rollup-3.6.0.tgz#2bff14b8680747fbb0228d102607d6a6e21859d7"
integrity sha512-qCgiBeSu2/AIOKWGFMiRkjPlGlcVwxAjwpGKQZOQYng+83Hip4PjrWHm7EQX1wnrvRqfTytEihRRfLHdX+hR4g==
rollup@^3.17.0:
version "3.17.0"
resolved "https://registry.yarnpkg.com/rollup/-/rollup-3.17.0.tgz#f5ab5ffc16838a4732f6f71f7f58ffd96e6521d1"
integrity sha512-0zZQ0J4p0ZtTla6l8sheDTUyNfGZQDpU5h0nPHf6xtUXIzKK70LmB2IRR0wLnzaL8a02fjmsJy+XCncbSwOpjg==
optionalDependencies:
fsevents "~2.3.2"

Expand Down
2 changes: 1 addition & 1 deletion vti/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@types/glob": "^8.0.1",
"chalk": "^4.1.2",
"glob": "^8.1.0",
"rollup": "^3.9.0",
"rollup": "^3.17.0",
"typescript": "^4.9.5",
"vscode-languageclient": "^7.0.0",
"vscode-languageserver": "^7.0.0",
Expand Down
8 changes: 4 additions & 4 deletions vti/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -859,10 +859,10 @@ rimraf@^3.0.2:
dependencies:
glob "^7.1.3"

rollup@^3.9.0:
version "3.9.0"
resolved "https://registry.yarnpkg.com/rollup/-/rollup-3.9.0.tgz#0ff7ab7cd71ce3a6ab140c5cf661f2b35eb6aab8"
integrity sha512-nGGylpmblyjTpF4lEUPgmOw6OVxRvnI6Iuuh6Lz4O/X66cVOX1XJSsqP1YamxQ+mPuFE7qJxLFDSCk8rNv5dDw==
rollup@^3.17.0:
version "3.17.0"
resolved "https://registry.yarnpkg.com/rollup/-/rollup-3.17.0.tgz#f5ab5ffc16838a4732f6f71f7f58ffd96e6521d1"
integrity sha512-0zZQ0J4p0ZtTla6l8sheDTUyNfGZQDpU5h0nPHf6xtUXIzKK70LmB2IRR0wLnzaL8a02fjmsJy+XCncbSwOpjg==
optionalDependencies:
fsevents "~2.3.2"

Expand Down
Loading

0 comments on commit 18b4322

Please sign in to comment.