mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-17 23:35:54 +01:00
Use esbuild instead of webpack to bundle the css extension
Switches from webpack to esbuild to bundle the css extension. Tested this locally in a browser and creating an official build to test the bundled extension still work correctly
This commit is contained in:
@@ -6,16 +6,12 @@ client/src/**
|
||||
server/src/**
|
||||
client/out/**
|
||||
server/out/**
|
||||
client/tsconfig.json
|
||||
server/tsconfig.json
|
||||
**/tsconfig*.json
|
||||
server/test/**
|
||||
server/bin/**
|
||||
server/build/**
|
||||
server/package-lock.json
|
||||
server/.npmignore
|
||||
package-lock.json
|
||||
server/extension.webpack.config.js
|
||||
extension.webpack.config.js
|
||||
server/extension-browser.webpack.config.js
|
||||
extension-browser.webpack.config.js
|
||||
**/esbuild*.mts
|
||||
CONTRIBUTING.md
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"exclude": [
|
||||
"./src/node/**",
|
||||
"./src/test/**"
|
||||
]
|
||||
}
|
||||
36
extensions/css-language-features/esbuild.browser.mts
Normal file
36
extensions/css-language-features/esbuild.browser.mts
Normal file
@@ -0,0 +1,36 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
import * as path from 'node:path';
|
||||
import { run } from '../esbuild-extension-common.mts';
|
||||
|
||||
const extensionRoot = import.meta.dirname;
|
||||
|
||||
await Promise.all([
|
||||
// Build client
|
||||
run({
|
||||
platform: 'browser',
|
||||
entryPoints: {
|
||||
'cssClientMain': path.join(extensionRoot, 'client', 'src', 'browser', 'cssClientMain.ts'),
|
||||
},
|
||||
srcDir: path.join(extensionRoot, 'client', 'src'),
|
||||
outdir: path.join(extensionRoot, 'client', 'dist', 'browser'),
|
||||
additionalOptions: {
|
||||
tsconfig: path.join(extensionRoot, 'client', 'tsconfig.browser.json'),
|
||||
},
|
||||
}, process.argv),
|
||||
|
||||
// Build server
|
||||
run({
|
||||
platform: 'browser',
|
||||
entryPoints: {
|
||||
'cssServerMain': path.join(extensionRoot, 'server', 'src', 'browser', 'cssServerWorkerMain.ts'),
|
||||
},
|
||||
srcDir: path.join(extensionRoot, 'server', 'src'),
|
||||
outdir: path.join(extensionRoot, 'server', 'dist', 'browser'),
|
||||
additionalOptions: {
|
||||
tsconfig: path.join(extensionRoot, 'server', 'tsconfig.browser.json'),
|
||||
},
|
||||
}, process.argv),
|
||||
]);
|
||||
36
extensions/css-language-features/esbuild.mts
Normal file
36
extensions/css-language-features/esbuild.mts
Normal file
@@ -0,0 +1,36 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
import * as path from 'node:path';
|
||||
import { run } from '../esbuild-extension-common.mts';
|
||||
|
||||
const extensionRoot = import.meta.dirname;
|
||||
|
||||
await Promise.all([
|
||||
// Build client
|
||||
run({
|
||||
platform: 'node',
|
||||
entryPoints: {
|
||||
'cssClientMain': path.join(extensionRoot, 'client', 'src', 'node', 'cssClientMain.ts'),
|
||||
},
|
||||
srcDir: path.join(extensionRoot, 'client', 'src'),
|
||||
outdir: path.join(extensionRoot, 'client', 'dist', 'node'),
|
||||
additionalOptions: {
|
||||
tsconfig: path.join(extensionRoot, 'client', 'tsconfig.json'),
|
||||
},
|
||||
}, process.argv),
|
||||
|
||||
// Build server
|
||||
run({
|
||||
platform: 'node',
|
||||
entryPoints: {
|
||||
'cssServerMain': path.join(extensionRoot, 'server', 'src', 'node', 'cssServerNodeMain.ts'),
|
||||
},
|
||||
srcDir: path.join(extensionRoot, 'server', 'src'),
|
||||
outdir: path.join(extensionRoot, 'server', 'dist', 'node'),
|
||||
additionalOptions: {
|
||||
tsconfig: path.join(extensionRoot, 'server', 'tsconfig.json'),
|
||||
},
|
||||
}, process.argv),
|
||||
]);
|
||||
@@ -1,18 +0,0 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
// @ts-check
|
||||
import { browser as withBrowserDefaults } from '../shared.webpack.config.mjs';
|
||||
import path from 'path';
|
||||
|
||||
export default withBrowserDefaults({
|
||||
context: path.join(import.meta.dirname, 'client'),
|
||||
entry: {
|
||||
extension: './src/browser/cssClientMain.ts'
|
||||
},
|
||||
output: {
|
||||
filename: 'cssClientMain.js',
|
||||
path: path.join(import.meta.dirname, 'client', 'dist', 'browser')
|
||||
}
|
||||
});
|
||||
@@ -1,18 +0,0 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
// @ts-check
|
||||
import withDefaults from '../shared.webpack.config.mjs';
|
||||
import path from 'path';
|
||||
|
||||
export default withDefaults({
|
||||
context: path.join(import.meta.dirname, 'client'),
|
||||
entry: {
|
||||
extension: './src/node/cssClientMain.ts',
|
||||
},
|
||||
output: {
|
||||
filename: 'cssClientMain.js',
|
||||
path: path.join(import.meta.dirname, 'client', 'dist', 'node')
|
||||
}
|
||||
});
|
||||
@@ -1,20 +0,0 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
// @ts-check
|
||||
import { browser as withBrowserDefaults } from '../../shared.webpack.config.mjs';
|
||||
import path from 'path';
|
||||
|
||||
export default withBrowserDefaults({
|
||||
context: import.meta.dirname,
|
||||
entry: {
|
||||
extension: './src/browser/cssServerWorkerMain.ts',
|
||||
},
|
||||
output: {
|
||||
filename: 'cssServerMain.js',
|
||||
path: path.join(import.meta.dirname, 'dist', 'browser'),
|
||||
libraryTarget: 'var',
|
||||
library: 'serverExportVar'
|
||||
}
|
||||
});
|
||||
@@ -1,18 +0,0 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
// @ts-check
|
||||
import withDefaults from '../../shared.webpack.config.mjs';
|
||||
import path from 'path';
|
||||
|
||||
export default withDefaults({
|
||||
context: path.join(import.meta.dirname),
|
||||
entry: {
|
||||
extension: './src/node/cssServerNodeMain.ts',
|
||||
},
|
||||
output: {
|
||||
filename: 'cssServerMain.js',
|
||||
path: path.join(import.meta.dirname, 'dist', 'node'),
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"exclude": [
|
||||
"./src/node/**",
|
||||
"./src/test/**"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user