Files
vscode/extensions/markdown-language-features/esbuild.ts
Matt Bierner d434a65945 Use esbuild to pack the markdown extension for desktop and web (#294208)
* Try using esbuild to bundle our built-in extensions

Test switching to esbuild instead of webpack to bundle our buildin extensions. Setup so we can do this incrementally and starting with the markdown extension as a test

* Fix build ext media

* Fix .ts script name check

* Update comment

* Use ts for all scripts
2026-02-10 20:32:40 +00:00

28 lines
1.1 KiB
TypeScript

/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as fs from 'node:fs';
import * as path from 'node:path';
import { run } from '../esbuild-extension-common.ts';
const srcDir = path.join(import.meta.dirname, 'src');
const outDir = path.join(import.meta.dirname, 'dist');
/**
* Copy the language server worker main file to the output directory.
*/
async function copyServerWorkerMain(outDir: string): Promise<void> {
const srcPath = path.join(import.meta.dirname, 'node_modules', 'vscode-markdown-languageserver', 'dist', 'node', 'workerMain.js');
const destPath = path.join(outDir, 'serverWorkerMain.js');
await fs.promises.copyFile(srcPath, destPath);
}
run({
entryPoints: {
'extension': path.join(srcDir, 'extension.ts'),
},
srcDir,
outdir: outDir,
}, process.argv, copyServerWorkerMain);