From 51d83e06c3fc630ef2d4f02bd2712668927553f5 Mon Sep 17 00:00:00 2001 From: Matt Bierner <12821956+mjbvz@users.noreply.github.com> Date: Sun, 12 Oct 2025 22:21:14 -0700 Subject: [PATCH] Fix compile --- build/lib/standalone.js | 13 ++++++------- build/lib/standalone.ts | 13 ++++++------- build/lib/treeshaking.ts | 2 -- 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/build/lib/standalone.js b/build/lib/standalone.js index 21271247c38..270ae2d3d58 100644 --- a/build/lib/standalone.js +++ b/build/lib/standalone.js @@ -90,19 +90,19 @@ function extractEditor(options) { } } const copied = {}; - const copyFile = (fileName) => { + const copyFile = (fileName, toFileName) => { if (copied[fileName]) { return; } copied[fileName] = true; if (path_1.default.isAbsolute(fileName)) { const relativePath = path_1.default.relative(options.sourcesRoot, fileName); - const dstPath = path_1.default.join(options.destRoot, relativePath); + const dstPath = path_1.default.join(options.destRoot, toFileName ?? relativePath); writeFile(dstPath, fs_1.default.readFileSync(fileName)); } else { const srcPath = path_1.default.join(options.sourcesRoot, fileName); - const dstPath = path_1.default.join(options.destRoot, fileName); + const dstPath = path_1.default.join(options.destRoot, toFileName ?? fileName); writeFile(dstPath, fs_1.default.readFileSync(srcPath)); } }; @@ -134,10 +134,9 @@ function extractEditor(options) { } delete tsConfig.compilerOptions.moduleResolution; writeOutputFile('tsconfig.json', JSON.stringify(tsConfig, null, '\t')); - [ - 'vs/loader.js', - 'typings/css.d.ts' - ].forEach(copyFile); + copyFile('vs/loader.js'); + copyFile('typings/css.d.ts'); + copyFile('../node_modules/@vscode/tree-sitter-wasm/wasm/web-tree-sitter.d.ts', '@vscode/tree-sitter-wasm.d.ts'); } function transportCSS(module, enqueue, write) { if (!/\.css/.test(module)) { diff --git a/build/lib/standalone.ts b/build/lib/standalone.ts index 4534dee4f0c..9bbcbae94f8 100644 --- a/build/lib/standalone.ts +++ b/build/lib/standalone.ts @@ -62,7 +62,7 @@ export function extractEditor(options: tss.ITreeShakingOptions & { destRoot: str } } const copied: { [fileName: string]: boolean } = {}; - const copyFile = (fileName: string) => { + const copyFile = (fileName: string, toFileName?: string) => { if (copied[fileName]) { return; } @@ -70,11 +70,11 @@ export function extractEditor(options: tss.ITreeShakingOptions & { destRoot: str if (path.isAbsolute(fileName)) { const relativePath = path.relative(options.sourcesRoot, fileName); - const dstPath = path.join(options.destRoot, relativePath); + const dstPath = path.join(options.destRoot, toFileName ?? relativePath); writeFile(dstPath, fs.readFileSync(fileName)); } else { const srcPath = path.join(options.sourcesRoot, fileName); - const dstPath = path.join(options.destRoot, fileName); + const dstPath = path.join(options.destRoot, toFileName ?? fileName); writeFile(dstPath, fs.readFileSync(srcPath)); } }; @@ -110,10 +110,9 @@ export function extractEditor(options: tss.ITreeShakingOptions & { destRoot: str delete tsConfig.compilerOptions.moduleResolution; writeOutputFile('tsconfig.json', JSON.stringify(tsConfig, null, '\t')); - [ - 'vs/loader.js', - 'typings/css.d.ts' - ].forEach(copyFile); + copyFile('vs/loader.js'); + copyFile('typings/css.d.ts'); + copyFile('../node_modules/@vscode/tree-sitter-wasm/wasm/web-tree-sitter.d.ts', '@vscode/tree-sitter-wasm.d.ts'); } function transportCSS(module: string, enqueue: (module: string) => void, write: (path: string, contents: string | Buffer) => void): boolean { diff --git a/build/lib/treeshaking.ts b/build/lib/treeshaking.ts index df0f288fc30..37572229f01 100644 --- a/build/lib/treeshaking.ts +++ b/build/lib/treeshaking.ts @@ -55,8 +55,6 @@ export interface ITreeShakingOptions { * regex pattern to ignore certain imports e.g. `.css` imports */ importIgnorePattern: RegExp; - - // redirects: { [module: string]: string }; } export interface ITreeShakingResult {