webpack 5.31.2 → 5.33.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of webpack might be problematic. Click here for more details.
- package/lib/CaseSensitiveModulesWarning.js +3 -3
- package/lib/Compilation.js +488 -48
- package/lib/DefinePlugin.js +21 -5
- package/lib/EntryOptionPlugin.js +1 -0
- package/lib/FlagDependencyExportsPlugin.js +22 -0
- package/lib/Module.js +1 -1
- package/lib/ModuleGraph.js +24 -0
- package/lib/NormalModule.js +14 -3
- package/lib/NormalModuleFactory.js +15 -1
- package/lib/RuntimeModule.js +5 -1
- package/lib/RuntimePlugin.js +7 -2
- package/lib/WarnCaseSensitiveModulesPlugin.js +15 -9
- package/lib/WebpackOptionsApply.js +3 -1
- package/lib/asset/AssetModulesPlugin.js +13 -0
- package/lib/config/defaults.js +1 -3
- package/lib/config/normalization.js +1 -0
- package/lib/container/RemoteRuntimeModule.js +2 -1
- package/lib/dependencies/HarmonyExportDependencyParserPlugin.js +7 -3
- package/lib/dependencies/HarmonyExportImportedSpecifierDependency.js +191 -39
- package/lib/dependencies/LoaderImportDependency.js +28 -0
- package/lib/dependencies/LoaderPlugin.js +134 -2
- package/lib/javascript/ArrayPushCallbackChunkFormatPlugin.js +2 -2
- package/lib/javascript/CommonJsChunkFormatPlugin.js +2 -2
- package/lib/javascript/JavascriptModulesPlugin.js +67 -2
- package/lib/library/AbstractLibraryPlugin.js +26 -8
- package/lib/node/CommonJsChunkLoadingPlugin.js +3 -1
- package/lib/node/ReadFileChunkLoadingRuntimeModule.js +2 -2
- package/lib/node/ReadFileCompileAsyncWasmPlugin.js +3 -1
- package/lib/node/ReadFileCompileWasmPlugin.js +3 -1
- package/lib/node/RequireChunkLoadingRuntimeModule.js +2 -2
- package/lib/prefetch/ChunkPrefetchPreloadPlugin.js +2 -4
- package/lib/runtime/CompatRuntimeModule.js +1 -2
- package/lib/runtime/GetChunkFilenameRuntimeModule.js +3 -2
- package/lib/runtime/PublicPathRuntimeModule.js +5 -5
- package/lib/runtime/RuntimeIdRuntimeModule.js +1 -2
- package/lib/runtime/StartupChunkDependenciesPlugin.js +5 -3
- package/lib/runtime/StartupChunkDependenciesRuntimeModule.js +2 -2
- package/lib/serialization/ObjectMiddleware.js +13 -4
- package/lib/sharing/ConsumeSharedRuntimeModule.js +2 -5
- package/lib/sharing/ShareRuntimeModule.js +2 -2
- package/lib/stats/DefaultStatsFactoryPlugin.js +5 -0
- package/lib/stats/DefaultStatsPrinterPlugin.js +2 -0
- package/lib/util/AsyncQueue.js +45 -10
- package/lib/util/WeakTupleMap.js +168 -0
- package/lib/util/processAsyncTree.js +3 -2
- package/lib/wasm-sync/WasmChunkLoadingRuntimeModule.js +2 -2
- package/lib/web/FetchCompileAsyncWasmPlugin.js +3 -1
- package/lib/web/FetchCompileWasmPlugin.js +3 -1
- package/lib/web/JsonpChunkLoadingPlugin.js +3 -1
- package/lib/web/JsonpChunkLoadingRuntimeModule.js +1 -2
- package/lib/webworker/ImportScriptsChunkLoadingPlugin.js +3 -1
- package/lib/webworker/ImportScriptsChunkLoadingRuntimeModule.js +1 -1
- package/package.json +3 -3
- package/schemas/WebpackOptions.json +10 -0
- package/types.d.ts +131 -14
package/lib/DefinePlugin.js
CHANGED
@@ -13,6 +13,7 @@ const {
|
|
13
13
|
evaluateToString,
|
14
14
|
toConstantDependency
|
15
15
|
} = require("./javascript/JavascriptParserHelpers");
|
16
|
+
const { provide } = require("./util/MapHelpers");
|
16
17
|
|
17
18
|
/** @typedef {import("estree").Expression} Expression */
|
18
19
|
/** @typedef {import("./Compiler")} Compiler */
|
@@ -53,7 +54,7 @@ class RuntimeValue {
|
|
53
54
|
|
54
55
|
/**
|
55
56
|
* @param {JavascriptParser} parser the parser
|
56
|
-
* @param {Map<string, string
|
57
|
+
* @param {Map<string, string | Set<string>>} valueCacheVersions valueCacheVersions
|
57
58
|
* @param {string} key the defined key
|
58
59
|
* @returns {CodeValuePrimitive} code
|
59
60
|
*/
|
@@ -88,7 +89,9 @@ class RuntimeValue {
|
|
88
89
|
module: parser.state.module,
|
89
90
|
key,
|
90
91
|
get version() {
|
91
|
-
return valueCacheVersions.get(
|
92
|
+
return /** @type {string} */ (valueCacheVersions.get(
|
93
|
+
VALUE_DEP_PREFIX + key
|
94
|
+
));
|
92
95
|
}
|
93
96
|
});
|
94
97
|
}
|
@@ -105,7 +108,7 @@ class RuntimeValue {
|
|
105
108
|
/**
|
106
109
|
* @param {any[]|{[k: string]: any}} obj obj
|
107
110
|
* @param {JavascriptParser} parser Parser
|
108
|
-
* @param {Map<string, string
|
111
|
+
* @param {Map<string, string | Set<string>>} valueCacheVersions valueCacheVersions
|
109
112
|
* @param {string} key the defined key
|
110
113
|
* @param {RuntimeTemplate} runtimeTemplate the runtime template
|
111
114
|
* @param {boolean|undefined|null=} asiSafe asi safe (undefined: unknown, null: unneeded)
|
@@ -156,7 +159,7 @@ const stringifyObj = (
|
|
156
159
|
* Convert code to a string that evaluates
|
157
160
|
* @param {CodeValue} code Code to evaluate
|
158
161
|
* @param {JavascriptParser} parser Parser
|
159
|
-
* @param {Map<string, string
|
162
|
+
* @param {Map<string, string | Set<string>>} valueCacheVersions valueCacheVersions
|
160
163
|
* @param {string} key the defined key
|
161
164
|
* @param {RuntimeTemplate} runtimeTemplate the runtime template
|
162
165
|
* @param {boolean|undefined|null=} asiSafe asi safe (undefined: unknown, null: unneeded)
|
@@ -247,6 +250,7 @@ const toCacheVersion = code => {
|
|
247
250
|
};
|
248
251
|
|
249
252
|
const VALUE_DEP_PREFIX = "webpack/DefinePlugin ";
|
253
|
+
const VALUE_DEP_MAIN = "webpack/DefinePlugin";
|
250
254
|
|
251
255
|
class DefinePlugin {
|
252
256
|
/**
|
@@ -282,16 +286,27 @@ class DefinePlugin {
|
|
282
286
|
);
|
283
287
|
const { runtimeTemplate } = compilation;
|
284
288
|
|
289
|
+
const mainValue = /** @type {Set<string>} */ (provide(
|
290
|
+
compilation.valueCacheVersions,
|
291
|
+
VALUE_DEP_MAIN,
|
292
|
+
() => new Set()
|
293
|
+
));
|
294
|
+
|
285
295
|
/**
|
286
296
|
* Handler
|
287
297
|
* @param {JavascriptParser} parser Parser
|
288
298
|
* @returns {void}
|
289
299
|
*/
|
290
300
|
const handler = parser => {
|
291
|
-
|
301
|
+
parser.hooks.program.tap("DefinePlugin", () => {
|
292
302
|
const { buildInfo } = parser.state.module;
|
293
303
|
if (!buildInfo.valueDependencies)
|
294
304
|
buildInfo.valueDependencies = new Map();
|
305
|
+
buildInfo.valueDependencies.set(VALUE_DEP_MAIN, mainValue);
|
306
|
+
});
|
307
|
+
|
308
|
+
const addValueDependency = key => {
|
309
|
+
const { buildInfo } = parser.state.module;
|
295
310
|
buildInfo.valueDependencies.set(
|
296
311
|
VALUE_DEP_PREFIX + key,
|
297
312
|
compilation.valueCacheVersions.get(VALUE_DEP_PREFIX + key)
|
@@ -546,6 +561,7 @@ class DefinePlugin {
|
|
546
561
|
const code = definitions[key];
|
547
562
|
const version = toCacheVersion(code);
|
548
563
|
const name = VALUE_DEP_PREFIX + prefix + key;
|
564
|
+
mainValue.add(name);
|
549
565
|
const oldVersion = compilation.valueCacheVersions.get(name);
|
550
566
|
if (oldVersion === undefined) {
|
551
567
|
compilation.valueCacheVersions.set(name, version);
|
package/lib/EntryOptionPlugin.js
CHANGED
@@ -12,6 +12,7 @@ const Queue = require("./util/Queue");
|
|
12
12
|
/** @typedef {import("./DependenciesBlock")} DependenciesBlock */
|
13
13
|
/** @typedef {import("./Dependency")} Dependency */
|
14
14
|
/** @typedef {import("./Dependency").ExportSpec} ExportSpec */
|
15
|
+
/** @typedef {import("./Dependency").ExportsSpec} ExportsSpec */
|
15
16
|
/** @typedef {import("./ExportsInfo")} ExportsInfo */
|
16
17
|
/** @typedef {import("./Module")} Module */
|
17
18
|
|
@@ -93,6 +94,9 @@ class FlagDependencyExportsPlugin {
|
|
93
94
|
/** @type {ExportsInfo} */
|
94
95
|
let exportsInfo;
|
95
96
|
|
97
|
+
/** @type {Map<Dependency, ExportsSpec>} */
|
98
|
+
const exportsSpecsFromDependencies = new Map();
|
99
|
+
|
96
100
|
let cacheable = true;
|
97
101
|
let changed = false;
|
98
102
|
|
@@ -116,6 +120,15 @@ class FlagDependencyExportsPlugin {
|
|
116
120
|
const processDependency = dep => {
|
117
121
|
const exportDesc = dep.getExports(moduleGraph);
|
118
122
|
if (!exportDesc) return;
|
123
|
+
exportsSpecsFromDependencies.set(dep, exportDesc);
|
124
|
+
};
|
125
|
+
|
126
|
+
/**
|
127
|
+
* @param {Dependency} dep dependency
|
128
|
+
* @param {ExportsSpec} exportDesc info
|
129
|
+
* @returns {void}
|
130
|
+
*/
|
131
|
+
const processExportsSpec = (dep, exportDesc) => {
|
119
132
|
const exports = exportDesc.exports;
|
120
133
|
const globalCanMangle = exportDesc.canMangle;
|
121
134
|
const globalFrom = exportDesc.from;
|
@@ -300,7 +313,16 @@ class FlagDependencyExportsPlugin {
|
|
300
313
|
cacheable = true;
|
301
314
|
changed = false;
|
302
315
|
|
316
|
+
exportsSpecsFromDependencies.clear();
|
317
|
+
moduleGraph.freeze();
|
303
318
|
processDependenciesBlock(module);
|
319
|
+
moduleGraph.unfreeze();
|
320
|
+
for (const [
|
321
|
+
dep,
|
322
|
+
exportsSpec
|
323
|
+
] of exportsSpecsFromDependencies) {
|
324
|
+
processExportsSpec(dep, exportsSpec);
|
325
|
+
}
|
304
326
|
|
305
327
|
if (cacheable) {
|
306
328
|
modulesToStore.add(module);
|
package/lib/Module.js
CHANGED
@@ -94,7 +94,7 @@ const makeSerializable = require("./util/makeSerializable");
|
|
94
94
|
/**
|
95
95
|
* @typedef {Object} NeedBuildContext
|
96
96
|
* @property {FileSystemInfo} fileSystemInfo
|
97
|
-
* @property {Map<string, string
|
97
|
+
* @property {Map<string, string | Set<string>>} valueCacheVersions
|
98
98
|
*/
|
99
99
|
|
100
100
|
/** @typedef {KnownBuildMeta & Record<string, any>} BuildMeta */
|
package/lib/ModuleGraph.js
CHANGED
@@ -9,6 +9,7 @@ const util = require("util");
|
|
9
9
|
const ExportsInfo = require("./ExportsInfo");
|
10
10
|
const ModuleGraphConnection = require("./ModuleGraphConnection");
|
11
11
|
const SortableSet = require("./util/SortableSet");
|
12
|
+
const WeakTupleMap = require("./util/WeakTupleMap");
|
12
13
|
|
13
14
|
/** @typedef {import("./DependenciesBlock")} DependenciesBlock */
|
14
15
|
/** @typedef {import("./Dependency")} Dependency */
|
@@ -110,6 +111,9 @@ class ModuleGraph {
|
|
110
111
|
this._cacheModuleGraphModuleValue2 = undefined;
|
111
112
|
this._cacheModuleGraphDependencyKey = undefined;
|
112
113
|
this._cacheModuleGraphDependencyValue = undefined;
|
114
|
+
|
115
|
+
/** @type {WeakTupleMap<any[], any>} */
|
116
|
+
this._cache = undefined;
|
113
117
|
}
|
114
118
|
|
115
119
|
/**
|
@@ -699,6 +703,26 @@ class ModuleGraph {
|
|
699
703
|
return this._metaMap.get(thing);
|
700
704
|
}
|
701
705
|
|
706
|
+
freeze() {
|
707
|
+
this._cache = new WeakTupleMap();
|
708
|
+
}
|
709
|
+
|
710
|
+
unfreeze() {
|
711
|
+
this._cache = undefined;
|
712
|
+
}
|
713
|
+
|
714
|
+
/**
|
715
|
+
* @template {any[]} T
|
716
|
+
* @template V
|
717
|
+
* @param {(moduleGraph: ModuleGraph, ...args: T) => V} fn computer
|
718
|
+
* @param {T} args arguments
|
719
|
+
* @returns {V} computed value or cached
|
720
|
+
*/
|
721
|
+
cached(fn, ...args) {
|
722
|
+
if (this._cache === undefined) return fn(this, ...args);
|
723
|
+
return this._cache.provide(fn, ...args, () => fn(this, ...args));
|
724
|
+
}
|
725
|
+
|
702
726
|
// TODO remove in webpack 6
|
703
727
|
/**
|
704
728
|
* @param {Module} module the module
|
package/lib/NormalModule.js
CHANGED
@@ -28,6 +28,7 @@ const UnhandledSchemeError = require("./UnhandledSchemeError");
|
|
28
28
|
const WebpackError = require("./WebpackError");
|
29
29
|
const formatLocation = require("./formatLocation");
|
30
30
|
const LazySet = require("./util/LazySet");
|
31
|
+
const { isSubset } = require("./util/SetHelpers");
|
31
32
|
const { getScheme } = require("./util/URLAbsoluteSpecifier");
|
32
33
|
const {
|
33
34
|
compareLocations,
|
@@ -1151,12 +1152,22 @@ class NormalModule extends Module {
|
|
1151
1152
|
if (!this.buildInfo.snapshot) return callback(null, true);
|
1152
1153
|
|
1153
1154
|
// build when valueDependencies have changed
|
1154
|
-
|
1155
|
+
/** @type {Map<string, string | Set<string>>} */
|
1156
|
+
const valueDependencies = this.buildInfo.valueDependencies;
|
1157
|
+
if (valueDependencies) {
|
1155
1158
|
if (!valueCacheVersions) return callback(null, true);
|
1156
|
-
for (const [key, value] of
|
1159
|
+
for (const [key, value] of valueDependencies) {
|
1157
1160
|
if (value === undefined) return callback(null, true);
|
1158
1161
|
const current = valueCacheVersions.get(key);
|
1159
|
-
if (
|
1162
|
+
if (
|
1163
|
+
value !== current &&
|
1164
|
+
(typeof value === "string" ||
|
1165
|
+
typeof current === "string" ||
|
1166
|
+
current === undefined ||
|
1167
|
+
!isSubset(value, current))
|
1168
|
+
) {
|
1169
|
+
return callback(null, true);
|
1170
|
+
}
|
1160
1171
|
}
|
1161
1172
|
}
|
1162
1173
|
|
@@ -496,7 +496,21 @@ class NormalModuleFactory extends ModuleFactory {
|
|
496
496
|
for (const loader of loaders) allLoaders.push(loader);
|
497
497
|
}
|
498
498
|
for (const loader of preLoaders) allLoaders.push(loader);
|
499
|
-
|
499
|
+
let type = settings.type;
|
500
|
+
if (!type) {
|
501
|
+
const resource =
|
502
|
+
(matchResourceData && matchResourceData.resource) ||
|
503
|
+
resourceData.resource;
|
504
|
+
let match;
|
505
|
+
if (
|
506
|
+
typeof resource === "string" &&
|
507
|
+
(match = /\.webpack\[([^\]]+)\]$/.exec(resource))
|
508
|
+
) {
|
509
|
+
type = match[1];
|
510
|
+
} else {
|
511
|
+
type = "javascript/auto";
|
512
|
+
}
|
513
|
+
}
|
500
514
|
const resolveOptions = settings.resolve;
|
501
515
|
const layer = settings.layer;
|
502
516
|
if (layer !== undefined && !layers) {
|
package/lib/RuntimeModule.js
CHANGED
@@ -41,6 +41,8 @@ class RuntimeModule extends Module {
|
|
41
41
|
this.compilation = undefined;
|
42
42
|
/** @type {Chunk} */
|
43
43
|
this.chunk = undefined;
|
44
|
+
/** @type {ChunkGraph} */
|
45
|
+
this.chunkGraph = undefined;
|
44
46
|
this.fullHash = false;
|
45
47
|
/** @type {string} */
|
46
48
|
this._cachedGeneratedCode = undefined;
|
@@ -49,11 +51,13 @@ class RuntimeModule extends Module {
|
|
49
51
|
/**
|
50
52
|
* @param {Compilation} compilation the compilation
|
51
53
|
* @param {Chunk} chunk the chunk
|
54
|
+
* @param {ChunkGraph} chunkGraph the chunk graph
|
52
55
|
* @returns {void}
|
53
56
|
*/
|
54
|
-
attach(compilation, chunk) {
|
57
|
+
attach(compilation, chunk, chunkGraph = compilation.chunkGraph) {
|
55
58
|
this.compilation = compilation;
|
56
59
|
this.chunk = chunk;
|
60
|
+
this.chunkGraph = chunkGraph;
|
57
61
|
}
|
58
62
|
|
59
63
|
/**
|
package/lib/RuntimePlugin.js
CHANGED
@@ -176,14 +176,19 @@ class RuntimePlugin {
|
|
176
176
|
.for(RuntimeGlobals.publicPath)
|
177
177
|
.tap("RuntimePlugin", (chunk, set) => {
|
178
178
|
const { outputOptions } = compilation;
|
179
|
-
const { publicPath, scriptType } = outputOptions;
|
179
|
+
const { publicPath: globalPublicPath, scriptType } = outputOptions;
|
180
|
+
const entryOptions = chunk.getEntryOptions();
|
181
|
+
const publicPath =
|
182
|
+
entryOptions && entryOptions.publicPath !== undefined
|
183
|
+
? entryOptions.publicPath
|
184
|
+
: globalPublicPath;
|
180
185
|
|
181
186
|
if (publicPath === "auto") {
|
182
187
|
const module = new AutoPublicPathRuntimeModule();
|
183
188
|
if (scriptType !== "module") set.add(RuntimeGlobals.global);
|
184
189
|
compilation.addRuntimeModule(chunk, module);
|
185
190
|
} else {
|
186
|
-
const module = new PublicPathRuntimeModule();
|
191
|
+
const module = new PublicPathRuntimeModule(publicPath);
|
187
192
|
|
188
193
|
if (
|
189
194
|
typeof publicPath !== "string" ||
|
@@ -8,6 +8,7 @@
|
|
8
8
|
const CaseSensitiveModulesWarning = require("./CaseSensitiveModulesWarning");
|
9
9
|
|
10
10
|
/** @typedef {import("./Compiler")} Compiler */
|
11
|
+
/** @typedef {import("./Module")} Module */
|
11
12
|
|
12
13
|
class WarnCaseSensitiveModulesPlugin {
|
13
14
|
/**
|
@@ -20,21 +21,26 @@ class WarnCaseSensitiveModulesPlugin {
|
|
20
21
|
"WarnCaseSensitiveModulesPlugin",
|
21
22
|
compilation => {
|
22
23
|
compilation.hooks.seal.tap("WarnCaseSensitiveModulesPlugin", () => {
|
24
|
+
/** @type {Map<string, Map<string, Module>>} */
|
23
25
|
const moduleWithoutCase = new Map();
|
24
26
|
for (const module of compilation.modules) {
|
25
|
-
const identifier = module.identifier()
|
26
|
-
const
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
moduleWithoutCase.set(
|
27
|
+
const identifier = module.identifier();
|
28
|
+
const lowerIdentifier = identifier.toLowerCase();
|
29
|
+
let map = moduleWithoutCase.get(lowerIdentifier);
|
30
|
+
if (map === undefined) {
|
31
|
+
map = new Map();
|
32
|
+
moduleWithoutCase.set(lowerIdentifier, map);
|
31
33
|
}
|
34
|
+
map.set(identifier, module);
|
32
35
|
}
|
33
36
|
for (const pair of moduleWithoutCase) {
|
34
|
-
const
|
35
|
-
if (
|
37
|
+
const map = pair[1];
|
38
|
+
if (map.size > 1) {
|
36
39
|
compilation.warnings.push(
|
37
|
-
new CaseSensitiveModulesWarning(
|
40
|
+
new CaseSensitiveModulesWarning(
|
41
|
+
map.values(),
|
42
|
+
compilation.moduleGraph
|
43
|
+
)
|
38
44
|
);
|
39
45
|
}
|
40
46
|
}
|
@@ -296,7 +296,9 @@ class WebpackOptionsApply extends OptionsApply {
|
|
296
296
|
new RequireJsStuffPlugin().apply(compiler);
|
297
297
|
}
|
298
298
|
new CommonJsPlugin().apply(compiler);
|
299
|
-
new LoaderPlugin(
|
299
|
+
new LoaderPlugin({
|
300
|
+
enableExecuteModule: options.experiments.executeModule
|
301
|
+
}).apply(compiler);
|
300
302
|
if (options.node !== false) {
|
301
303
|
const NodeStuffPlugin = require("./NodeStuffPlugin");
|
302
304
|
new NodeStuffPlugin(options.node).apply(compiler);
|
@@ -176,6 +176,19 @@ class AssetModulesPlugin {
|
|
176
176
|
|
177
177
|
return result;
|
178
178
|
});
|
179
|
+
|
180
|
+
compilation.hooks.prepareModuleExecution.tap(
|
181
|
+
"AssetModulesPlugin",
|
182
|
+
(options, context) => {
|
183
|
+
const { codeGenerationResult } = options;
|
184
|
+
const source = codeGenerationResult.sources.get("asset");
|
185
|
+
if (source === undefined) return;
|
186
|
+
context.assets.set(codeGenerationResult.data.get("filename"), {
|
187
|
+
source,
|
188
|
+
info: codeGenerationResult.data.get("assetInfo")
|
189
|
+
});
|
190
|
+
}
|
191
|
+
);
|
179
192
|
}
|
180
193
|
);
|
181
194
|
}
|
package/lib/config/defaults.js
CHANGED
@@ -431,9 +431,6 @@ const applyModuleDefaults = (
|
|
431
431
|
};
|
432
432
|
/** @type {RuleSetRules} */
|
433
433
|
const rules = [
|
434
|
-
{
|
435
|
-
type: "javascript/auto"
|
436
|
-
},
|
437
434
|
{
|
438
435
|
mimetype: "application/node",
|
439
436
|
type: "javascript/auto"
|
@@ -1031,6 +1028,7 @@ const getResolveDefaults = ({ cache, context, targetProperties, mode }) => {
|
|
1031
1028
|
byDependency: {
|
1032
1029
|
wasm: esmDeps(),
|
1033
1030
|
esm: esmDeps(),
|
1031
|
+
loaderImport: esmDeps(),
|
1034
1032
|
url: {
|
1035
1033
|
preferRelative: true
|
1036
1034
|
},
|
@@ -20,7 +20,8 @@ class RemoteRuntimeModule extends RuntimeModule {
|
|
20
20
|
* @returns {string} runtime code
|
21
21
|
*/
|
22
22
|
generate() {
|
23
|
-
const {
|
23
|
+
const { compilation, chunkGraph } = this;
|
24
|
+
const { runtimeTemplate, moduleGraph } = compilation;
|
24
25
|
const chunkToRemotesMapping = {};
|
25
26
|
const idToExternalAndNameMapping = {};
|
26
27
|
for (const chunk of this.chunk.getAllAsyncChunks()) {
|
@@ -16,6 +16,8 @@ const {
|
|
16
16
|
} = require("./HarmonyImportDependencyParserPlugin");
|
17
17
|
const HarmonyImportSideEffectDependency = require("./HarmonyImportSideEffectDependency");
|
18
18
|
|
19
|
+
const { HarmonyStarExportsList } = HarmonyExportImportedSpecifierDependency;
|
20
|
+
|
19
21
|
module.exports = class HarmonyExportDependencyParserPlugin {
|
20
22
|
constructor(options) {
|
21
23
|
this.strictExportPresence = options.strictExportPresence;
|
@@ -124,7 +126,8 @@ module.exports = class HarmonyExportDependencyParserPlugin {
|
|
124
126
|
name,
|
125
127
|
harmonyNamedExports,
|
126
128
|
null,
|
127
|
-
this.strictExportPresence
|
129
|
+
this.strictExportPresence,
|
130
|
+
null
|
128
131
|
);
|
129
132
|
} else {
|
130
133
|
dep = new HarmonyExportSpecifierDependency(id, name);
|
@@ -145,7 +148,7 @@ module.exports = class HarmonyExportDependencyParserPlugin {
|
|
145
148
|
harmonyNamedExports.add(name);
|
146
149
|
} else {
|
147
150
|
harmonyStarExports = parser.state.harmonyStarExports =
|
148
|
-
parser.state.harmonyStarExports ||
|
151
|
+
parser.state.harmonyStarExports || new HarmonyStarExportsList();
|
149
152
|
}
|
150
153
|
const dep = new HarmonyExportImportedSpecifierDependency(
|
151
154
|
source,
|
@@ -154,7 +157,8 @@ module.exports = class HarmonyExportDependencyParserPlugin {
|
|
154
157
|
name,
|
155
158
|
harmonyNamedExports,
|
156
159
|
harmonyStarExports && harmonyStarExports.slice(),
|
157
|
-
this.strictExportPresence
|
160
|
+
this.strictExportPresence,
|
161
|
+
harmonyStarExports
|
158
162
|
);
|
159
163
|
if (harmonyStarExports) {
|
160
164
|
harmonyStarExports.push(dep);
|