mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-02 00:09:30 +01:00
Enhance source map handling in build tasks for CI environments
This commit is contained in:
@@ -237,8 +237,9 @@ function runTsGoTypeCheck(): Promise<void> {
|
||||
}
|
||||
|
||||
const sourceMappingURLBase = `https://main.vscode-cdn.net/sourcemaps/${commit}`;
|
||||
const useCdnSourceMapsForPackagingTasks = !!process.env['CI'];
|
||||
const stripSourceMapsInPackagingTasks = !!process.env['CI'];
|
||||
const isCI = !!process.env['CI'] || !!process.env['BUILD_ARTIFACTSTAGINGDIRECTORY'] || !!process.env['GITHUB_WORKSPACE'];
|
||||
const useCdnSourceMapsForPackagingTasks = isCI;
|
||||
const stripSourceMapsInPackagingTasks = isCI;
|
||||
const minifyVSCodeTask = task.define('minify-vscode', task.series(
|
||||
bundleVSCodeTask,
|
||||
util.rimraf('out-vscode-min'),
|
||||
|
||||
@@ -33,7 +33,7 @@ const quality = (product as { quality?: string }).quality;
|
||||
const version = (quality && quality !== 'stable') ? `${packageJson.version}-${quality}` : packageJson.version;
|
||||
|
||||
// esbuild-based bundle for standalone web
|
||||
function runEsbuildBundle(outDir: string, minify: boolean, nls: boolean): Promise<void> {
|
||||
function runEsbuildBundle(outDir: string, minify: boolean, nls: boolean, sourceMapBaseUrl?: string): Promise<void> {
|
||||
return new Promise((resolve, reject) => {
|
||||
const scriptPath = path.join(REPO_ROOT, 'build/next/index.ts');
|
||||
const args = [scriptPath, 'bundle', '--out', outDir, '--target', 'web'];
|
||||
@@ -44,6 +44,9 @@ function runEsbuildBundle(outDir: string, minify: boolean, nls: boolean): Promis
|
||||
if (nls) {
|
||||
args.push('--nls');
|
||||
}
|
||||
if (sourceMapBaseUrl) {
|
||||
args.push('--source-map-base-url', sourceMapBaseUrl);
|
||||
}
|
||||
|
||||
const proc = cp.spawn(process.execPath, args, {
|
||||
cwd: REPO_ROOT,
|
||||
@@ -164,8 +167,9 @@ const minifyVSCodeWebTask = task.define('minify-vscode-web-OLD', task.series(
|
||||
gulp.task(minifyVSCodeWebTask);
|
||||
|
||||
// esbuild-based tasks (new)
|
||||
const sourceMappingURLBase = `https://main.vscode-cdn.net/sourcemaps/${commit}`;
|
||||
const esbuildBundleVSCodeWebTask = task.define('esbuild-vscode-web', () => runEsbuildBundle('out-vscode-web', false, true));
|
||||
const esbuildBundleVSCodeWebMinTask = task.define('esbuild-vscode-web-min', () => runEsbuildBundle('out-vscode-web-min', true, true));
|
||||
const esbuildBundleVSCodeWebMinTask = task.define('esbuild-vscode-web-min', () => runEsbuildBundle('out-vscode-web-min', true, true, `${sourceMappingURLBase}/core`));
|
||||
|
||||
function packageTask(sourceFolderName: string, destinationFolderName: string) {
|
||||
const destination = path.join(BUILD_ROOT, destinationFolderName);
|
||||
|
||||
Reference in New Issue
Block a user