From c30ffc4a7ee3c0a0b72c21d7f8e7c9c317420c2d Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Tue, 9 Nov 2021 23:41:02 +0100 Subject: [PATCH] Fix problem with duplicated entry points --- build/lib/bundle.js | 3 +++ build/lib/bundle.ts | 3 +++ src/buildfile.js | 4 ++-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/build/lib/bundle.js b/build/lib/bundle.js index 7d0c8d9b55e..143e64e087d 100644 --- a/build/lib/bundle.js +++ b/build/lib/bundle.js @@ -14,6 +14,9 @@ const vm = require("vm"); function bundle(entryPoints, config, callback) { const entryPointsMap = {}; entryPoints.forEach((module) => { + if (entryPointsMap[module.name]) { + throw new Error(`Cannot have two entry points with the same name '${module.name}'`); + } entryPointsMap[module.name] = module; }); const allMentionedModulesMap = {}; diff --git a/build/lib/bundle.ts b/build/lib/bundle.ts index 562b050d1fd..ce1f6e61662 100644 --- a/build/lib/bundle.ts +++ b/build/lib/bundle.ts @@ -100,6 +100,9 @@ export interface ILoaderConfig { export function bundle(entryPoints: IEntryPoint[], config: ILoaderConfig, callback: (err: any, result: IBundleResult | null) => void): void { const entryPointsMap: IEntryPointMap = {}; entryPoints.forEach((module: IEntryPoint) => { + if (entryPointsMap[module.name]) { + throw new Error(`Cannot have two entry points with the same name '${module.name}'`); + } entryPointsMap[module.name] = module; }); diff --git a/src/buildfile.js b/src/buildfile.js index 7588e1f8b3c..5b9b061df45 100644 --- a/src/buildfile.js +++ b/src/buildfile.js @@ -7,8 +7,8 @@ const { createModuleDescription, createEditorWorkerModuleDescription } = require exports.base = [ { - name: 'vs/base/common/worker/simpleWorker', - include: ['vs/editor/common/services/editorSimpleWorker'], + name: 'vs/editor/common/services/editorSimpleWorker', + include: ['vs/base/common/worker/simpleWorker'], prepend: ['vs/loader.js', 'vs/nls.js'], append: ['vs/base/worker/workerMain'], dest: 'vs/base/worker/workerMain.js'