Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move to esbuild and latest libs #1896

Merged
merged 2 commits into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 32 additions & 32 deletions client/package-lock.json

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

6 changes: 3 additions & 3 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
"url": "https://github.com/Microsoft/vscode-eslint/issues"
},
"engines": {
"vscode": "^1.90.0"
"vscode": "^1.91.0"
},
"devDependencies": {
"@types/vscode": "1.90.0"
"@types/vscode": "1.91.0"
},
"dependencies": {
"vscode-languageclient": "10.0.0-next.8"
"vscode-languageclient": "10.0.0-next.9"
},
"scripts": {
"test": "node ../node_modules/mocha/bin/_mocha",
Expand Down
6 changes: 3 additions & 3 deletions client/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"extends": "../tsconfig.base.json",
"compilerOptions": {
"module": "commonjs",
"target": "es2020",
"module": "Node16",
"target": "ES2022",
"outDir": "out",
"rootDir": "src",
"lib": [ "es2020" ],
"lib": [ "ES2023" ],
"sourceMap": true
},
"include": [
Expand Down
25 changes: 0 additions & 25 deletions client/webpack.config.js

This file was deleted.

62 changes: 62 additions & 0 deletions esbuild.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
//@ts-check
const esbuild = require('esbuild');

/**
* @typedef {import('esbuild').BuildOptions} BuildOptions
*/

/** @type BuildOptions */
const clientOptions = {
bundle: true,
external: ['vscode'],
target: 'ES2022',
platform: 'node',
sourcemap: false,
entryPoints: ['client/src/extension.ts'],
outfile: 'client/out/extension.js',
preserveSymlinks: true,
format: 'cjs',
};

/** @type BuildOptions */
const serverOptions = {
bundle: true,
target: 'ES2022',
platform: 'node',
sourcemap: false,
entryPoints: ['server/src/eslintServer.ts'],
outfile: 'server/out/eslintServer.js',
preserveSymlinks: true,
format: 'cjs',
};

function createContexts() {
return Promise.all([
esbuild.context(clientOptions),
esbuild.context(serverOptions),
]);
}

createContexts().then(contexts => {
if (process.argv[2] === '--watch') {
const promises = [];
for (const context of contexts) {
promises.push(context.watch());
}
return Promise.all(promises).then(() => { return undefined; });
} else {
const promises = [];
for (const context of contexts) {
promises.push(context.rebuild());
}
Promise.all(promises).then(async () => {
for (const context of contexts) {
await context.dispose();
}
}).then(() => { return undefined; }).catch(console.error);
}
}).catch(console.error);
Loading