mirror of
https://github.com/microsoft/vscode.git
synced 2026-02-04 01:44:44 -06:00
parent
63c58419fd
commit
9ad93e319e
@ -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/**
|
||||
|
||||
@ -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',
|
||||
|
||||
@ -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))
|
||||
);
|
||||
});
|
||||
|
||||
@ -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 {};
|
||||
})();
|
||||
1891
src/vs/loader.js
1891
src/vs/loader.js
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user