mirror of https://github.com/microsoft/vscode.git
esm - cleanup editor worker build descriptors
This commit is contained in:
parent
6849275026
commit
c1952297c5
|
@ -16,7 +16,7 @@ function createModuleDescription(name, exclude) {
|
|||
}
|
||||
|
||||
return {
|
||||
name: name,
|
||||
name,
|
||||
include: [],
|
||||
exclude: excludes
|
||||
};
|
||||
|
@ -26,40 +26,13 @@ function createModuleDescription(name, exclude) {
|
|||
* @param {string} name
|
||||
*/
|
||||
function createEditorWorkerModuleDescription(name) {
|
||||
const amdVariant = createModuleDescription(name, ['vs/base/common/worker/simpleWorker', 'vs/editor/common/services/editorSimpleWorker']);
|
||||
amdVariant.target = 'amd';
|
||||
const description = createModuleDescription(name, ['vs/base/common/worker/simpleWorker', 'vs/editor/common/services/editorSimpleWorker']);
|
||||
description.name = `${description.name}.esm`;
|
||||
|
||||
const esmVariant = { ...amdVariant, dest: undefined };
|
||||
esmVariant.target = 'esm';
|
||||
esmVariant.name = `${esmVariant.name}.esm`;
|
||||
|
||||
return [amdVariant, esmVariant];
|
||||
return description;
|
||||
}
|
||||
|
||||
// TODO@esm take the editor simple worker top level and rename away from "base"
|
||||
exports.base = [
|
||||
{
|
||||
name: 'vs/editor/common/services/editorSimpleWorker',
|
||||
include: ['vs/base/common/worker/simpleWorker'],
|
||||
exclude: [],
|
||||
prepend: [
|
||||
{ path: 'vs/loader.js' },
|
||||
{ path: 'vs/base/worker/workerMain.js' }
|
||||
],
|
||||
dest: 'vs/base/worker/workerMain.js',
|
||||
target: 'amd'
|
||||
},
|
||||
{
|
||||
name: 'vs/editor/common/services/editorSimpleWorker.esm',
|
||||
target: 'esm'
|
||||
},
|
||||
{
|
||||
name: 'vs/base/common/worker/simpleWorker',
|
||||
exclude: [],
|
||||
target: 'amd'
|
||||
}
|
||||
];
|
||||
|
||||
exports.workerEditor = createEditorWorkerModuleDescription('vs/editor/common/services/editorSimpleWorker');
|
||||
exports.workerExtensionHost = createEditorWorkerModuleDescription('vs/workbench/api/worker/extensionHostWorker');
|
||||
exports.workerNotebook = createEditorWorkerModuleDescription('vs/workbench/contrib/notebook/common/services/notebookSimpleWorker');
|
||||
exports.workerLanguageDetection = createEditorWorkerModuleDescription('vs/workbench/services/languageDetection/browser/languageDetectionSimpleWorker');
|
||||
|
@ -93,8 +66,6 @@ exports.code = [
|
|||
createModuleDescription('vs/code/electron-sandbox/processExplorer/processExplorerMain')
|
||||
];
|
||||
|
||||
exports.codeWeb = [
|
||||
createModuleDescription('vs/code/browser/workbench/workbench')
|
||||
];
|
||||
exports.codeWeb = createModuleDescription('vs/code/browser/workbench/workbench');
|
||||
|
||||
exports.entrypoint = createModuleDescription;
|
||||
|
|
|
@ -128,7 +128,7 @@ const serverEntryPoints = [
|
|||
];
|
||||
|
||||
const webEntryPoints = [
|
||||
buildfile.base,
|
||||
buildfile.workerEditor,
|
||||
buildfile.workerExtensionHost,
|
||||
buildfile.workerNotebook,
|
||||
buildfile.workerLanguageDetection,
|
||||
|
|
|
@ -38,7 +38,7 @@ const rcedit = promisify(require('rcedit'));
|
|||
|
||||
// Build
|
||||
const vscodeEntryPoints = [
|
||||
buildfile.base,
|
||||
buildfile.workerEditor,
|
||||
buildfile.workerExtensionHost,
|
||||
buildfile.workerNotebook,
|
||||
buildfile.workerLanguageDetection,
|
||||
|
|
|
@ -73,7 +73,7 @@ const vscodeWebResources = [
|
|||
const buildfile = require('./buildfile');
|
||||
|
||||
const vscodeWebEntryPoints = [
|
||||
buildfile.base,
|
||||
buildfile.workerEditor,
|
||||
buildfile.workerExtensionHost,
|
||||
buildfile.workerNotebook,
|
||||
buildfile.workerLanguageDetection,
|
||||
|
|
|
@ -53,7 +53,6 @@ export interface IEntryPoint {
|
|||
exclude?: string[];
|
||||
prepend?: IExtraFile[];
|
||||
dest?: string;
|
||||
target?: 'amd' | 'esm';
|
||||
}
|
||||
|
||||
interface IEntryPointMap {
|
||||
|
|
|
@ -264,7 +264,7 @@ const skippedExportMangledFiles = [
|
|||
// entry points
|
||||
...[
|
||||
buildfile.entrypoint('vs/server/node/server.main'),
|
||||
buildfile.base,
|
||||
buildfile.workerEditor,
|
||||
buildfile.workerExtensionHost,
|
||||
buildfile.workerNotebook,
|
||||
buildfile.workerLanguageDetection,
|
||||
|
|
|
@ -300,7 +300,7 @@ const skippedExportMangledFiles = [
|
|||
// entry points
|
||||
...[
|
||||
buildfile.entrypoint('vs/server/node/server.main'),
|
||||
buildfile.base,
|
||||
buildfile.workerEditor,
|
||||
buildfile.workerExtensionHost,
|
||||
buildfile.workerNotebook,
|
||||
buildfile.workerLanguageDetection,
|
||||
|
|
|
@ -105,7 +105,7 @@ const DEFAULT_FILE_HEADER = [
|
|||
function optimizeESMTask(opts, cjsOpts) {
|
||||
const resourcesStream = es.through(); // this stream will contain the resources
|
||||
const bundlesStream = es.through(); // this stream will contain the bundled files
|
||||
const entryPoints = opts.entryPoints.filter(d => d.target !== 'amd');
|
||||
const entryPoints = opts.entryPoints;
|
||||
if (cjsOpts) {
|
||||
cjsOpts.entryPoints.forEach(entryPoint => entryPoints.push({ name: path.parse(entryPoint).name }));
|
||||
}
|
||||
|
|
|
@ -163,7 +163,7 @@ function optimizeESMTask(opts: IOptimizeAMDTaskOpts, cjsOpts?: IOptimizeCommonJS
|
|||
const resourcesStream = es.through(); // this stream will contain the resources
|
||||
const bundlesStream = es.through(); // this stream will contain the bundled files
|
||||
|
||||
const entryPoints = opts.entryPoints.filter(d => d.target !== 'amd');
|
||||
const entryPoints = opts.entryPoints;
|
||||
if (cjsOpts) {
|
||||
cjsOpts.entryPoints.forEach(entryPoint => entryPoints.push({ name: path.parse(entryPoint).name }));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue