Fix problem with duplicated entry points

This commit is contained in:
Alex Dima 2021-11-09 23:41:02 +01:00
parent 6670578157
commit c30ffc4a7e
No known key found for this signature in database
GPG key ID: 39563C1504FDD0C9
3 changed files with 8 additions and 2 deletions

View file

@ -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 = {};

View file

@ -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;
});

View file

@ -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'