feat: refactoring project
This commit is contained in:
11
node_modules/webpack/lib/container/ContainerEntryModule.js
generated
vendored
11
node_modules/webpack/lib/container/ContainerEntryModule.js
generated
vendored
@@ -8,6 +8,7 @@
|
||||
const { OriginalSource, RawSource } = require("webpack-sources");
|
||||
const AsyncDependenciesBlock = require("../AsyncDependenciesBlock");
|
||||
const Module = require("../Module");
|
||||
const { JS_TYPES } = require("../ModuleSourceTypesConstants");
|
||||
const { JAVASCRIPT_MODULE_TYPE_DYNAMIC } = require("../ModuleTypeConstants");
|
||||
const RuntimeGlobals = require("../RuntimeGlobals");
|
||||
const Template = require("../Template");
|
||||
@@ -41,8 +42,6 @@ const ContainerExposedDependency = require("./ContainerExposedDependency");
|
||||
|
||||
/** @typedef {[string, ExposeOptions][]} ExposesList */
|
||||
|
||||
const SOURCE_TYPES = new Set(["javascript"]);
|
||||
|
||||
class ContainerEntryModule extends Module {
|
||||
/**
|
||||
* @param {string} name container entry name
|
||||
@@ -60,7 +59,7 @@ class ContainerEntryModule extends Module {
|
||||
* @returns {SourceTypes} types available (do not mutate)
|
||||
*/
|
||||
getSourceTypes() {
|
||||
return SOURCE_TYPES;
|
||||
return JS_TYPES;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -77,7 +76,7 @@ class ContainerEntryModule extends Module {
|
||||
* @returns {string} a user readable identifier of the module
|
||||
*/
|
||||
readableIdentifier(requestShortener) {
|
||||
return `container entry`;
|
||||
return "container entry";
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -205,7 +204,7 @@ class ContainerEntryModule extends Module {
|
||||
}
|
||||
|
||||
const source = Template.asString([
|
||||
`var moduleMap = {`,
|
||||
"var moduleMap = {",
|
||||
Template.indent(getters.join(",\n")),
|
||||
"};",
|
||||
`var get = ${runtimeTemplate.basicFunction("module, getScope", [
|
||||
@@ -230,7 +229,7 @@ class ContainerEntryModule extends Module {
|
||||
`if (!${RuntimeGlobals.shareScopeMap}) return;`,
|
||||
`var name = ${JSON.stringify(this._shareScope)}`,
|
||||
`var oldScope = ${RuntimeGlobals.shareScopeMap}[name];`,
|
||||
`if(oldScope && oldScope !== shareScope) throw new Error("Container initialization failed as it has already been initialized with a different share scope");`,
|
||||
'if(oldScope && oldScope !== shareScope) throw new Error("Container initialization failed as it has already been initialized with a different share scope");',
|
||||
`${RuntimeGlobals.shareScopeMap}[name] = shareScope;`,
|
||||
`return ${RuntimeGlobals.initializeSharing}(name, initScope);`
|
||||
])};`,
|
||||
|
||||
Reference in New Issue
Block a user