Remove src/vs/loader.js (fix #285255) (#286727)

This commit is contained in:
Benjamin Pasero 2026-01-09 15:13:32 +01:00 committed by GitHub
parent 63c58419fd
commit 9ad93e319e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 1 additions and 1961 deletions

View File

@ -33,7 +33,6 @@
**/src/typings/**/*.d.ts
**/src/vs/*/**/*.d.ts
**/src/vs/base/test/common/filters.perf.data.js
**/src/vs/loader.js
**/test/unit/assert.js
**/test/automation/out/**
**/typings/**

View File

@ -77,7 +77,6 @@ export const indentationFilter = Object.freeze<string[]>([
'!LICENSES.chromium.html',
'!**/LICENSE',
'!**/*.mp3',
'!src/vs/loader.js',
'!src/vs/base/browser/dompurify/*',
'!src/vs/base/common/marked/marked.js',
'!src/vs/base/common/semver/semver.js',

View File

@ -77,7 +77,7 @@ const compileEditorESMTask = task.define('compile-editor-esm', () => {
fileHeader: BUNDLED_FILE_HEADER,
languages: [...i18n.defaultLanguages, ...i18n.extraLanguages],
}))
.pipe(filter(['**', '!**/inlineEntryPoint*', '!**/tsconfig.json', '!**/loader.js']))
.pipe(filter(['**', '!**/inlineEntryPoint*', '!**/tsconfig.json']))
.pipe(gulp.dest(out))
);
});

View File

@ -1,67 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
export const snaps = (() => {
const fs = require('fs');
const path = require('path');
const os = require('os');
const cp = require('child_process');
const mksnapshot = path.join(import.meta.dirname, `../../node_modules/.bin/${process.platform === 'win32' ? 'mksnapshot.cmd' : 'mksnapshot'}`);
const product = require('../../product.json');
const arch = (process.argv.join('').match(/--arch=(.*)/) || [])[1];
//
let loaderFilepath: string;
let startupBlobFilepath: string;
switch (process.platform) {
case 'darwin':
loaderFilepath = `VSCode-darwin/${product.nameLong}.app/Contents/Resources/app/out/vs/loader.js`;
startupBlobFilepath = `VSCode-darwin/${product.nameLong}.app/Contents/Frameworks/Electron Framework.framework/Resources/snapshot_blob.bin`;
break;
case 'win32':
case 'linux':
loaderFilepath = `VSCode-${process.platform}-${arch}/resources/app/out/vs/loader.js`;
startupBlobFilepath = `VSCode-${process.platform}-${arch}/snapshot_blob.bin`;
break;
default:
throw new Error('Unknown platform');
}
loaderFilepath = path.join(import.meta.dirname, '../../../', loaderFilepath);
startupBlobFilepath = path.join(import.meta.dirname, '../../../', startupBlobFilepath);
snapshotLoader(loaderFilepath, startupBlobFilepath);
function snapshotLoader(loaderFilepath: string, startupBlobFilepath: string): void {
const inputFile = fs.readFileSync(loaderFilepath);
const wrappedInputFile = `
var Monaco_Loader_Init;
(function() {
var doNotInitLoader = true;
${inputFile.toString()};
Monaco_Loader_Init = function() {
AMDLoader.init();
CSSLoaderPlugin.init();
NLSLoaderPlugin.init();
return { define, require };
}
})();
`;
const wrappedInputFilepath = path.join(os.tmpdir(), 'wrapped-loader.js');
console.log(wrappedInputFilepath);
fs.writeFileSync(wrappedInputFilepath, wrappedInputFile);
cp.execFileSync(mksnapshot, [wrappedInputFilepath, `--startup_blob`, startupBlobFilepath]);
}
return {};
})();

File diff suppressed because it is too large Load Diff