Skip to content

Commit

Permalink
Fix problem with duplicated entry points
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdima committed Nov 9, 2021
1 parent 6670578 commit c30ffc4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions build/lib/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {};
Expand Down
3 changes: 3 additions & 0 deletions build/lib/bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});

Expand Down
4 changes: 2 additions & 2 deletions src/buildfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit c30ffc4

Please sign in to comment.