Skip to content

Commit 01c52f7

Browse files
authored
Move to esbuild and latest libs (#1896)
* Move to esbuild and latest libs * Fix compile error
1 parent 496ae4b commit 01c52f7

13 files changed

+935
-310
lines changed

client/package-lock.json

+32-32
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414
"url": "https://github.com/Microsoft/vscode-eslint/issues"
1515
},
1616
"engines": {
17-
"vscode": "^1.90.0"
17+
"vscode": "^1.91.0"
1818
},
1919
"devDependencies": {
20-
"@types/vscode": "1.90.0"
20+
"@types/vscode": "1.91.0"
2121
},
2222
"dependencies": {
23-
"vscode-languageclient": "10.0.0-next.8"
23+
"vscode-languageclient": "10.0.0-next.9"
2424
},
2525
"scripts": {
2626
"test": "node ../node_modules/mocha/bin/_mocha",

client/tsconfig.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"extends": "../tsconfig.base.json",
33
"compilerOptions": {
4-
"module": "commonjs",
5-
"target": "es2020",
4+
"module": "Node16",
5+
"target": "ES2022",
66
"outDir": "out",
77
"rootDir": "src",
8-
"lib": [ "es2020" ],
8+
"lib": [ "ES2023" ],
99
"sourceMap": true
1010
},
1111
"include": [

client/webpack.config.js

-25
This file was deleted.

esbuild.js

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
/*---------------------------------------------------------------------------------------------
2+
* Copyright (c) Microsoft Corporation. All rights reserved.
3+
* Licensed under the MIT License. See License.txt in the project root for license information.
4+
*--------------------------------------------------------------------------------------------*/
5+
//@ts-check
6+
const esbuild = require('esbuild');
7+
8+
/**
9+
* @typedef {import('esbuild').BuildOptions} BuildOptions
10+
*/
11+
12+
/** @type BuildOptions */
13+
const clientOptions = {
14+
bundle: true,
15+
external: ['vscode'],
16+
target: 'ES2022',
17+
platform: 'node',
18+
sourcemap: false,
19+
entryPoints: ['client/src/extension.ts'],
20+
outfile: 'client/out/extension.js',
21+
preserveSymlinks: true,
22+
format: 'cjs',
23+
};
24+
25+
/** @type BuildOptions */
26+
const serverOptions = {
27+
bundle: true,
28+
target: 'ES2022',
29+
platform: 'node',
30+
sourcemap: false,
31+
entryPoints: ['server/src/eslintServer.ts'],
32+
outfile: 'server/out/eslintServer.js',
33+
preserveSymlinks: true,
34+
format: 'cjs',
35+
};
36+
37+
function createContexts() {
38+
return Promise.all([
39+
esbuild.context(clientOptions),
40+
esbuild.context(serverOptions),
41+
]);
42+
}
43+
44+
createContexts().then(contexts => {
45+
if (process.argv[2] === '--watch') {
46+
const promises = [];
47+
for (const context of contexts) {
48+
promises.push(context.watch());
49+
}
50+
return Promise.all(promises).then(() => { return undefined; });
51+
} else {
52+
const promises = [];
53+
for (const context of contexts) {
54+
promises.push(context.rebuild());
55+
}
56+
Promise.all(promises).then(async () => {
57+
for (const context of contexts) {
58+
await context.dispose();
59+
}
60+
}).then(() => { return undefined; }).catch(console.error);
61+
}
62+
}).catch(console.error);

0 commit comments

Comments
 (0)