From 9a9079bf2654ca2ecb385f4a1c9735a333d168be Mon Sep 17 00:00:00 2001 From: Johannes Date: Mon, 9 Feb 2026 21:11:03 +0100 Subject: [PATCH] esbuild: --- build/next/index.ts | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/build/next/index.ts b/build/next/index.ts index 29528a79cd0..62a3c2c177b 100644 --- a/build/next/index.ts +++ b/build/next/index.ts @@ -207,19 +207,23 @@ function getCssBundleEntryPointsForTarget(target: BuildTarget): Set { // Common resources needed by all targets const commonResourcePatterns = [ - // Fonts - 'vs/base/browser/ui/codicons/codicon/codicon.ttf', - - // Vendor JavaScript libraries (not transpiled) - 'vs/base/common/marked/marked.js', - 'vs/base/common/semver/semver.js', - 'vs/base/browser/dompurify/dompurify.js', - // Tree-sitter queries 'vs/editor/common/languages/highlights/*.scm', 'vs/editor/common/languages/injections/*.scm', ]; +// Resources only needed for dev/transpile builds (these get bundled into the main +// JS/CSS bundles for production, so separate copies are redundant) +const devOnlyResourcePatterns = [ + // Fonts (esbuild file loader copies to media/codicon.ttf for production) + 'vs/base/browser/ui/codicons/codicon/codicon.ttf', + + // Vendor JavaScript libraries (bundled into workbench main JS for production) + 'vs/base/common/marked/marked.js', + 'vs/base/common/semver/semver.js', + 'vs/base/browser/dompurify/dompurify.js', +]; + // Resources for desktop target const desktopResourcePatterns = [ ...commonResourcePatterns, @@ -552,6 +556,21 @@ async function copyResources(outDir: string, target: BuildTarget, excludeDevFile } } + // Copy dev-only resources (vendor JS, codicon font) - only for development/transpile + // builds. In production bundles these are inlined by esbuild. + if (!excludeDevFiles) { + for (const pattern of devOnlyResourcePatterns) { + const files = await globAsync(pattern, { + cwd: path.join(REPO_ROOT, SRC_DIR), + ignore: ignorePatterns, + }); + for (const file of files) { + await copyFile(path.join(REPO_ROOT, SRC_DIR, file), path.join(REPO_ROOT, outDir, file)); + copied++; + } + } + } + // Copy CSS files (only for development/transpile builds, not production bundles // where CSS is already bundled into combined files like workbench.desktop.main.css) if (!excludeDevFiles) {