@depup/webpack 5.110.1-depup.0 → 5.110.3-depup.0
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.
- package/README.md +4 -4
- package/changes.json +3 -3
- package/lib/ChunkGraph.js +20 -18
- package/lib/Compilation.js +1 -1
- package/lib/ConcatenationScope.js +25 -35
- package/lib/DotenvPlugin.js +41 -13
- package/lib/ExportsInfo.js +10 -0
- package/lib/FlagDependencyUsagePlugin.js +8 -2
- package/lib/NormalModule.js +13 -20
- package/lib/RuntimePlugin.js +3 -0
- package/lib/RuntimeTemplate.js +437 -432
- package/lib/async-modules/AsyncModuleHelpers.js +10 -4
- package/lib/config/defaults.js +26 -16
- package/lib/config/normalization.js +18 -8
- package/lib/css/CssLoadingRuntimeModule.js +32 -13
- package/lib/css/CssModulesPlugin.js +9 -17
- package/lib/css/data.js +13 -3
- package/lib/css/syntax.js +78 -10
- package/lib/dependencies/CommonJsRequireDependency.js +18 -4
- package/lib/dependencies/ContextDependencyTemplateAsRequireCall.js +20 -7
- package/lib/dependencies/HarmonyEvaluatedImportSpecifierDependency.js +10 -4
- package/lib/dependencies/HarmonyExportDependencyParserPlugin.js +2 -0
- package/lib/dependencies/HarmonyExportImportedSpecifierDependency.js +143 -17
- package/lib/dependencies/HarmonyImportDependency.js +94 -41
- package/lib/dependencies/HarmonyImportDependencyParserPlugin.js +93 -14
- package/lib/dependencies/HarmonyImportSideEffectDependency.js +114 -0
- package/lib/dependencies/HtmlEntryDependency.js +12 -2
- package/lib/dependencies/ImportContextDependency.js +43 -3
- package/lib/dependencies/ImportDependency.js +8 -29
- package/lib/dependencies/ImportParserPlugin.js +24 -14
- package/lib/dependencies/RequireHeaderDependency.js +20 -21
- package/lib/dependencies/WorkerAndWorkletPlugin.js +1 -0
- package/lib/dependencies/WorkerDependency.js +6 -12
- package/lib/dependencies/WorkletDependency.js +7 -11
- package/lib/dependencies/importOptionsCheck.js +47 -0
- package/lib/errors/DotenvFileError.js +29 -0
- package/lib/errors/ImportedBindingAssignmentError.js +30 -0
- package/lib/esm/ModuleChunkLoadingPlugin.js +6 -9
- package/lib/esm/ModuleChunkLoadingRuntimeModule.js +7 -1
- package/lib/html/HtmlModulesPlugin.js +84 -38
- package/lib/html/syntax.js +417 -169
- package/lib/javascript/JavascriptModulesPlugin.js +5 -10
- package/lib/loaders/LoaderRunner.js +33 -5
- package/lib/node/ReadFileCompileAsyncWasmPlugin.js +8 -15
- package/lib/optimize/ConcatenatedModule.js +46 -7
- package/lib/optimize/ConstExportsPlugin.js +5 -0
- package/lib/optimize/InlineExports.js +121 -0
- package/lib/optimize/RealContentHashPlugin.js +111 -35
- package/lib/prefetch/ResourceHintPlugin.js +12 -13
- package/lib/runtime/AsyncModuleRuntimeModule.js +5 -1
- package/lib/runtime/MakeDeferredNamespaceObjectRuntime.js +11 -1
- package/lib/schemes/HttpUriPlugin.js +22 -5
- package/lib/serialization/FileMiddleware.js +15 -2
- package/lib/typescript/TypeScriptPlugin.js +8 -10
- package/lib/util/ArrayQueue.js +3 -3
- package/lib/util/SourceProcessor.js +24 -8
- package/lib/util/URLAbsoluteSpecifier.js +3 -1
- package/lib/util/conventions.js +5 -1
- package/lib/util/createMappings.js +25 -3
- package/lib/util/internalSerializables.js +2 -0
- package/lib/util/removeBOM.js +82 -1
- package/lib/wasm-async/AsyncWasmCompileRuntimeModule.js +5 -3
- package/lib/wasm-async/AsyncWasmLoadingRuntimeModule.js +5 -3
- package/lib/wasm-async/UniversalCompileAsyncWasmPlugin.js +7 -12
- package/lib/web/FetchCompileAsyncWasmPlugin.js +10 -6
- package/lib/web/FetchCompileWasmPlugin.js +4 -2
- package/package.json +7 -7
- package/schemas/WebpackOptions.check.js +1 -1
- package/schemas/WebpackOptions.json +9 -10
- package/types.d.ts +95 -27
package/README.md
CHANGED
|
@@ -13,8 +13,8 @@ npm install @depup/webpack
|
|
|
13
13
|
|
|
14
14
|
| Field | Value |
|
|
15
15
|
|-------|-------|
|
|
16
|
-
| Original | [webpack](https://www.npmjs.com/package/webpack) @ 5.110.
|
|
17
|
-
| Processed | 2026-
|
|
16
|
+
| Original | [webpack](https://www.npmjs.com/package/webpack) @ 5.110.3 |
|
|
17
|
+
| Processed | 2026-09-06 |
|
|
18
18
|
| Smoke test | passed |
|
|
19
19
|
| Deps updated | 9 |
|
|
20
20
|
|
|
@@ -24,12 +24,12 @@ npm install @depup/webpack
|
|
|
24
24
|
|------------|------|-----|
|
|
25
25
|
| @types/estree | ^1.0.8 | ^1.0.9 |
|
|
26
26
|
| acorn | ^8.16.0 | ^8.18.0 |
|
|
27
|
-
| browserslist | ^4.28.1 | ^4.28.
|
|
27
|
+
| browserslist | ^4.28.1 | ^4.28.9 |
|
|
28
28
|
| chrome-trace-event | ^1.0.2 | ^1.0.4 |
|
|
29
29
|
| enhanced-resolve | ^5.24.4 | ^5.24.5 |
|
|
30
30
|
| es-module-lexer | ^2.1.0 | ^2.3.2 |
|
|
31
31
|
| events | ^3.2.0 | ^3.3.0 |
|
|
32
|
-
| minimizer-webpack-plugin | ^5.7.0 | ^5.
|
|
32
|
+
| minimizer-webpack-plugin | ^5.7.0 | ^5.9.0 |
|
|
33
33
|
| tapable | ^2.3.0 | ^2.3.3 |
|
|
34
34
|
|
|
35
35
|
---
|
package/changes.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
},
|
|
11
11
|
"browserslist": {
|
|
12
12
|
"from": "^4.28.1",
|
|
13
|
-
"to": "^4.28.
|
|
13
|
+
"to": "^4.28.9"
|
|
14
14
|
},
|
|
15
15
|
"chrome-trace-event": {
|
|
16
16
|
"from": "^1.0.2",
|
|
@@ -30,13 +30,13 @@
|
|
|
30
30
|
},
|
|
31
31
|
"minimizer-webpack-plugin": {
|
|
32
32
|
"from": "^5.7.0",
|
|
33
|
-
"to": "^5.
|
|
33
|
+
"to": "^5.9.0"
|
|
34
34
|
},
|
|
35
35
|
"tapable": {
|
|
36
36
|
"from": "^2.3.0",
|
|
37
37
|
"to": "^2.3.3"
|
|
38
38
|
}
|
|
39
39
|
},
|
|
40
|
-
"timestamp": "2026-
|
|
40
|
+
"timestamp": "2026-09-06T01:00:50.036Z",
|
|
41
41
|
"totalUpdated": 9
|
|
42
42
|
}
|
package/lib/ChunkGraph.js
CHANGED
|
@@ -1380,27 +1380,29 @@ class ChunkGraph {
|
|
|
1380
1380
|
|
|
1381
1381
|
for (const chunkGroup of chunk.groupsIterable) {
|
|
1382
1382
|
if (chunkGroup instanceof Entrypoint) {
|
|
1383
|
+
if (entrypoints.has(chunkGroup)) continue;
|
|
1384
|
+
entrypoints.add(chunkGroup);
|
|
1385
|
+
// `entrypoints` doubles as the visited set: a diamond of `dependOn`
|
|
1386
|
+
// edges would otherwise re-traverse the shared entrypoint per path
|
|
1383
1387
|
const queue = [chunkGroup];
|
|
1384
|
-
|
|
1385
|
-
const current = queue
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
queue.push(/** @type {Entrypoint} */ (child));
|
|
1388
|
+
for (let i = 0; i < queue.length; i++) {
|
|
1389
|
+
const current = queue[i];
|
|
1390
|
+
let hasChildrenEntrypoint = false;
|
|
1391
|
+
for (const child of current.childrenIterable) {
|
|
1392
|
+
if (child instanceof Entrypoint && child.dependOn(current)) {
|
|
1393
|
+
hasChildrenEntrypoint = true;
|
|
1394
|
+
if (!entrypoints.has(child)) {
|
|
1395
|
+
entrypoints.add(child);
|
|
1396
|
+
queue.push(child);
|
|
1394
1397
|
}
|
|
1395
1398
|
}
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
}
|
|
1399
|
+
}
|
|
1400
|
+
// an entrypoint others depend on has to be loaded before them,
|
|
1401
|
+
// unless it is the runtime chunk itself or carries its own runtime
|
|
1402
|
+
if (hasChildrenEntrypoint) {
|
|
1403
|
+
const entrypointChunk = current.getEntrypointChunk();
|
|
1404
|
+
if (entrypointChunk !== chunk && !entrypointChunk.hasRuntime()) {
|
|
1405
|
+
set.add(entrypointChunk);
|
|
1404
1406
|
}
|
|
1405
1407
|
}
|
|
1406
1408
|
}
|
package/lib/Compilation.js
CHANGED
|
@@ -4083,7 +4083,7 @@ Or do you want to use the entrypoints '${name}' and '${runtime}' independently o
|
|
|
4083
4083
|
const text = /** @type {string} */ (source.source());
|
|
4084
4084
|
// Everything the hook is handed is in the key: a tap answers per language
|
|
4085
4085
|
// pair, so identical text offered as two of them is two questions.
|
|
4086
|
-
const key = `${info.type}
|
|
4086
|
+
const key = `${info.type}\0${info.hostType}\0${text}`;
|
|
4087
4087
|
const resolved = this._embeddedSources.get(info.module);
|
|
4088
4088
|
if (resolved !== undefined) {
|
|
4089
4089
|
const hit = resolved.get(key);
|
|
@@ -19,9 +19,10 @@ const {
|
|
|
19
19
|
* ExportName as Ids
|
|
20
20
|
* } from "./optimize/ConcatenatedModule"
|
|
21
21
|
*/
|
|
22
|
-
/** @import { Range } from "./javascript/JavascriptParser" */
|
|
23
22
|
|
|
24
|
-
/** @typedef {{ start: number, end: number, name: string }} ModuleReferenceMatch */
|
|
23
|
+
/** @typedef {{ start: number, end: number, name: string, leaked: boolean }} ModuleReferenceMatch */
|
|
24
|
+
|
|
25
|
+
const MODULE_REFERENCE_TOKEN = "__WEBPACK_MODULE_REFERENCE__";
|
|
25
26
|
|
|
26
27
|
const MODULE_REFERENCE_REGEXP =
|
|
27
28
|
/^__WEBPACK_MODULE_REFERENCE__(\d+)_([\da-f]+|ns)(_call)?(_directImport)?(_deferredImport)?(_mangleableNs)?(_moduleExportsAccess)?(?:_asiSafe(\d))?__$/;
|
|
@@ -33,6 +34,8 @@ const MODULE_REFERENCE_SCAN_REGEXP = new RegExp(
|
|
|
33
34
|
"g"
|
|
34
35
|
);
|
|
35
36
|
|
|
37
|
+
const IDENTIFIER_CHARACTER_REGEXP = /[\w$]/;
|
|
38
|
+
|
|
36
39
|
/** @type {WeakMap<Source, ModuleReferenceMatch[]>} */
|
|
37
40
|
const moduleReferencesCache = new WeakMap();
|
|
38
41
|
|
|
@@ -76,10 +79,6 @@ class ConcatenationScope {
|
|
|
76
79
|
this.usedNames = usedNames;
|
|
77
80
|
/** @type {Map<Module, ModuleInfo>} */
|
|
78
81
|
this._modulesMap = modulesMap;
|
|
79
|
-
// written and read by dependency templates within a single code
|
|
80
|
-
// generation pass, never across passes
|
|
81
|
-
/** @type {Range[] | undefined} */
|
|
82
|
-
this._replacedRequireRanges = undefined;
|
|
83
82
|
}
|
|
84
83
|
|
|
85
84
|
/**
|
|
@@ -121,33 +120,6 @@ class ConcatenationScope {
|
|
|
121
120
|
return this._currentModule.wrapped;
|
|
122
121
|
}
|
|
123
122
|
|
|
124
|
-
/**
|
|
125
|
-
* Records a `require(...)` call that was replaced as a whole by a
|
|
126
|
-
* concatenation reference, so nothing else rewrites a range inside it.
|
|
127
|
-
* @param {Range} range source range of the replaced call
|
|
128
|
-
*/
|
|
129
|
-
registerReplacedRequire(range) {
|
|
130
|
-
if (this._replacedRequireRanges === undefined) {
|
|
131
|
-
this._replacedRequireRanges = [];
|
|
132
|
-
}
|
|
133
|
-
this._replacedRequireRanges.push(range);
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
* Checks whether an offset sits inside an already-replaced `require(...)` call.
|
|
138
|
-
* Containment, not exact match: `new require(...)` is replaced from `new`.
|
|
139
|
-
* @param {number} start start offset to test
|
|
140
|
-
* @returns {boolean} true, when the offset was replaced already
|
|
141
|
-
*/
|
|
142
|
-
isInsideReplacedRequire(start) {
|
|
143
|
-
const ranges = this._replacedRequireRanges;
|
|
144
|
-
if (ranges === undefined) return false;
|
|
145
|
-
for (const [rangeStart, rangeEnd] of ranges) {
|
|
146
|
-
if (start >= rangeStart && start < rangeEnd) return true;
|
|
147
|
-
}
|
|
148
|
-
return false;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
123
|
/**
|
|
152
124
|
* Records the symbol that should be used when the current module exports a
|
|
153
125
|
* named binding.
|
|
@@ -263,7 +235,22 @@ class ConcatenationScope {
|
|
|
263
235
|
}
|
|
264
236
|
|
|
265
237
|
/**
|
|
266
|
-
*
|
|
238
|
+
* Checks whether an identifier buries a reference token without being one,
|
|
239
|
+
* which nothing can resolve: it would reach the output as an undeclared global.
|
|
240
|
+
* @param {string} name the identifier
|
|
241
|
+
* @returns {boolean} true, when a reference token is buried in the identifier
|
|
242
|
+
*/
|
|
243
|
+
static isLeakedModuleReference(name) {
|
|
244
|
+
return (
|
|
245
|
+
name.includes(MODULE_REFERENCE_TOKEN) &&
|
|
246
|
+
!MODULE_REFERENCE_REGEXP.test(name)
|
|
247
|
+
);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* Finds all encoded module references in a generated source. A match that
|
|
252
|
+
* continues an identifier is reported as `leaked`: it is a token a wider
|
|
253
|
+
* replacement swallowed, so substituting it would rewrite the middle of a name.
|
|
267
254
|
* @param {Source} source generated source
|
|
268
255
|
* @returns {ModuleReferenceMatch[]} reference token positions (end is exclusive, excludes the appended "._")
|
|
269
256
|
*/
|
|
@@ -279,7 +266,10 @@ class ConcatenationScope {
|
|
|
279
266
|
result.push({
|
|
280
267
|
start: match.index,
|
|
281
268
|
end: match.index + match[0].length,
|
|
282
|
-
name: match[0]
|
|
269
|
+
name: match[0],
|
|
270
|
+
leaked:
|
|
271
|
+
match.index > 0 &&
|
|
272
|
+
IDENTIFIER_CHARACTER_REGEXP.test(code[match.index - 1])
|
|
283
273
|
});
|
|
284
274
|
match = MODULE_REFERENCE_SCAN_REGEXP.exec(code);
|
|
285
275
|
}
|
package/lib/DotenvPlugin.js
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
"use strict";
|
|
7
7
|
|
|
8
8
|
const FileSystemInfo = require("./FileSystemInfo");
|
|
9
|
+
const DotenvFileError = require("./errors/DotenvFileError");
|
|
9
10
|
const { join } = require("./util/fs");
|
|
10
11
|
|
|
11
12
|
/** @import { DotenvPluginOptions } from "../declarations/WebpackOptions" */
|
|
@@ -155,8 +156,8 @@ function expandValue(value, processEnv, runningParsed) {
|
|
|
155
156
|
const opMatch = expression.match(opRegex);
|
|
156
157
|
const splitter = opMatch ? opMatch[0] : null;
|
|
157
158
|
|
|
158
|
-
|
|
159
|
-
|
|
159
|
+
// `split(null)` splits on the string "null", cutting up names containing it
|
|
160
|
+
const r = splitter ? expression.split(splitter) : [expression];
|
|
160
161
|
|
|
161
162
|
/** @type {string} */
|
|
162
163
|
let defaultValue;
|
|
@@ -235,16 +236,21 @@ function expand(options) {
|
|
|
235
236
|
/**
|
|
236
237
|
* Format environment variables as DefinePlugin definitions
|
|
237
238
|
* @param {Env} env environment variables
|
|
238
|
-
* @returns {Record<string, string>} formatted definitions
|
|
239
|
+
* @returns {Record<string, string | Env>} formatted definitions
|
|
239
240
|
*/
|
|
240
241
|
const envToDefinitions = (env) => {
|
|
241
|
-
const definitions = /** @type {Record<string, string>} */ ({});
|
|
242
|
+
const definitions = /** @type {Record<string, string | Env>} */ ({});
|
|
243
|
+
// one nested definition rather than a `import.meta.env.<key>` per key: a
|
|
244
|
+
// dotted key would otherwise read back as a nested object, not as the key
|
|
245
|
+
const importMetaEnv = /** @type {Env} */ (Object.create(null));
|
|
242
246
|
|
|
243
247
|
for (const [key, value] of Object.entries(env)) {
|
|
244
248
|
const defValue = JSON.stringify(value);
|
|
249
|
+
// `process.env` stays flat — it must not shadow the real one at runtime
|
|
245
250
|
definitions[`process.env.${key}`] = defValue;
|
|
246
|
-
|
|
251
|
+
importMetaEnv[key] = defValue;
|
|
247
252
|
}
|
|
253
|
+
definitions["import.meta.env"] = importMetaEnv;
|
|
248
254
|
|
|
249
255
|
return definitions;
|
|
250
256
|
};
|
|
@@ -296,6 +302,8 @@ class DotenvPlugin {
|
|
|
296
302
|
|
|
297
303
|
/** @type {undefined | InstanceType<Snapshot>} */
|
|
298
304
|
let snapshot;
|
|
305
|
+
/** @type {undefined | DotenvFileError} */
|
|
306
|
+
let loadError;
|
|
299
307
|
|
|
300
308
|
const cache = compiler.getCache(PLUGIN_NAME);
|
|
301
309
|
const identifier = JSON.stringify(
|
|
@@ -304,16 +312,31 @@ class DotenvPlugin {
|
|
|
304
312
|
const itemCache = cache.getItemCache(identifier, null);
|
|
305
313
|
|
|
306
314
|
compiler.hooks.beforeCompile.tapPromise(PLUGIN_NAME, async () => {
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
315
|
+
loadError = undefined;
|
|
316
|
+
try {
|
|
317
|
+
const { parsed, snapshot: newSnapshot } = dir
|
|
318
|
+
? await this._loadEnv(compiler, itemCache, dir)
|
|
319
|
+
: { parsed: {} };
|
|
320
|
+
const env = this._getEnv(prefixes, parsed);
|
|
321
|
+
|
|
322
|
+
definePlugin.definitions = envToDefinitions(env || {});
|
|
323
|
+
snapshot = newSnapshot;
|
|
324
|
+
} catch (err) {
|
|
325
|
+
// reported on the compilation so watch mode recovers when it is fixed
|
|
326
|
+
if (!(err instanceof DotenvFileError)) throw err;
|
|
327
|
+
loadError = err;
|
|
328
|
+
definePlugin.definitions = envToDefinitions({});
|
|
329
|
+
snapshot = undefined;
|
|
330
|
+
}
|
|
314
331
|
});
|
|
315
332
|
|
|
316
333
|
compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation) => {
|
|
334
|
+
if (loadError) {
|
|
335
|
+
compilation.errors.push(loadError);
|
|
336
|
+
compilation.fileDependencies.add(
|
|
337
|
+
/** @type {string} */ (loadError.file)
|
|
338
|
+
);
|
|
339
|
+
}
|
|
317
340
|
if (snapshot) {
|
|
318
341
|
compilation.fileDependencies.addAll(snapshot.getFileIterable());
|
|
319
342
|
compilation.missingDependencies.addAll(snapshot.getMissingIterable());
|
|
@@ -369,7 +392,12 @@ class DotenvPlugin {
|
|
|
369
392
|
fileDependencies.push(filePath);
|
|
370
393
|
return content;
|
|
371
394
|
},
|
|
372
|
-
() => {
|
|
395
|
+
(err) => {
|
|
396
|
+
const code = /** @type {NodeJS.ErrnoException} */ (err).code;
|
|
397
|
+
// only an absent file is normal; anything else is a real fault
|
|
398
|
+
if (code !== "ENOENT" && code !== "ENOTDIR") {
|
|
399
|
+
throw new DotenvFileError(filePath, err);
|
|
400
|
+
}
|
|
373
401
|
// File doesn't exist, add to missingDependencies (this is normal)
|
|
374
402
|
missingDependencies.push(filePath);
|
|
375
403
|
return "";
|
package/lib/ExportsInfo.js
CHANGED
|
@@ -1747,6 +1747,16 @@ class ExportInfo {
|
|
|
1747
1747
|
return result;
|
|
1748
1748
|
}
|
|
1749
1749
|
|
|
1750
|
+
/**
|
|
1751
|
+
* Returns whether resolving the target leads back to this export, which
|
|
1752
|
+
* `getTarget` cannot express as it reports a cycle as "no target".
|
|
1753
|
+
* @param {ModuleGraph} moduleGraph the module graph
|
|
1754
|
+
* @returns {boolean} true, when the reexport chain is circular
|
|
1755
|
+
*/
|
|
1756
|
+
hasCircularTarget(moduleGraph) {
|
|
1757
|
+
return this._getTarget(moduleGraph, RETURNS_TRUE, undefined) === CIRCULAR;
|
|
1758
|
+
}
|
|
1759
|
+
|
|
1750
1760
|
/**
|
|
1751
1761
|
* Returns the target.
|
|
1752
1762
|
* @param {ModuleGraph} moduleGraph the module graph
|
|
@@ -345,10 +345,16 @@ class FlagDependencyUsagePlugin {
|
|
|
345
345
|
if (oldItem === undefined || Array.isArray(oldItem)) {
|
|
346
346
|
exportsMap.set(key, item);
|
|
347
347
|
} else {
|
|
348
|
+
// An unset flag means "allowed", so merge on `!== false`:
|
|
349
|
+
// `undefined && false` reads back as allowed.
|
|
348
350
|
exportsMap.set(key, {
|
|
349
351
|
name: item.name,
|
|
350
|
-
canMangle:
|
|
351
|
-
|
|
352
|
+
canMangle:
|
|
353
|
+
item.canMangle !== false &&
|
|
354
|
+
oldItem.canMangle !== false,
|
|
355
|
+
canInline:
|
|
356
|
+
item.canInline !== false &&
|
|
357
|
+
oldItem.canInline !== false
|
|
352
358
|
});
|
|
353
359
|
}
|
|
354
360
|
}
|
package/lib/NormalModule.js
CHANGED
|
@@ -109,7 +109,6 @@ const getModuleBuildError = memoize(() => require("./errors/ModuleBuildError"));
|
|
|
109
109
|
* BuildMeta,
|
|
110
110
|
* CodeGenerationContext,
|
|
111
111
|
* CodeGenerationResult,
|
|
112
|
-
* CodeGenerationResultData,
|
|
113
112
|
* ConcatenationBailoutReasonContext,
|
|
114
113
|
* KnownBuildInfo,
|
|
115
114
|
* LibIdentOptions,
|
|
@@ -119,7 +118,6 @@ const getModuleBuildError = memoize(() => require("./errors/ModuleBuildError"));
|
|
|
119
118
|
* NeedBuildCallback,
|
|
120
119
|
* BuildCallback,
|
|
121
120
|
* RuntimeRequirements,
|
|
122
|
-
* Sources,
|
|
123
121
|
* SourceType,
|
|
124
122
|
* SourceTypes
|
|
125
123
|
* } from "./Module"
|
|
@@ -728,11 +726,6 @@ class NormalModule extends Module {
|
|
|
728
726
|
this._sideEffectsStateGraph = undefined;
|
|
729
727
|
/** @type {ConnectionState | undefined} */
|
|
730
728
|
this._sideEffectsStateValue = undefined;
|
|
731
|
-
/**
|
|
732
|
-
* @private
|
|
733
|
-
* @type {CodeGenerationResultData}
|
|
734
|
-
*/
|
|
735
|
-
this._codeGeneratorData = new Map();
|
|
736
729
|
}
|
|
737
730
|
|
|
738
731
|
/**
|
|
@@ -1892,10 +1885,19 @@ class NormalModule extends Module {
|
|
|
1892
1885
|
runtimeRequirements.add(RuntimeGlobals.thisAsExports);
|
|
1893
1886
|
}
|
|
1894
1887
|
|
|
1895
|
-
|
|
1888
|
+
/** @type {CodeGenerationResult} */
|
|
1889
|
+
const resultEntry = {
|
|
1890
|
+
sources: new Map(),
|
|
1891
|
+
runtimeRequirements,
|
|
1892
|
+
data: undefined,
|
|
1893
|
+
hash: undefined
|
|
1894
|
+
};
|
|
1895
|
+
|
|
1896
|
+
const getData = () => {
|
|
1897
|
+
if (resultEntry.data === undefined) resultEntry.data = new Map();
|
|
1898
|
+
return resultEntry.data;
|
|
1899
|
+
};
|
|
1896
1900
|
|
|
1897
|
-
/** @type {Sources} */
|
|
1898
|
-
const sources = new Map();
|
|
1899
1901
|
for (const type of sourceTypes || chunkGraph.getModuleSourceTypes(this)) {
|
|
1900
1902
|
// TODO webpack@6 make generateError required
|
|
1901
1903
|
const generator =
|
|
@@ -1930,17 +1932,10 @@ class NormalModule extends Module {
|
|
|
1930
1932
|
});
|
|
1931
1933
|
|
|
1932
1934
|
if (source) {
|
|
1933
|
-
sources.set(type, new CachedSource(source));
|
|
1935
|
+
resultEntry.sources.set(type, new CachedSource(source));
|
|
1934
1936
|
}
|
|
1935
1937
|
}
|
|
1936
1938
|
|
|
1937
|
-
/** @type {CodeGenerationResult} */
|
|
1938
|
-
const resultEntry = {
|
|
1939
|
-
sources,
|
|
1940
|
-
runtimeRequirements,
|
|
1941
|
-
data: this._codeGeneratorData,
|
|
1942
|
-
hash: undefined
|
|
1943
|
-
};
|
|
1944
1939
|
return resultEntry;
|
|
1945
1940
|
}
|
|
1946
1941
|
|
|
@@ -2116,7 +2111,6 @@ class NormalModule extends Module {
|
|
|
2116
2111
|
write(this.error);
|
|
2117
2112
|
write(this._lastSuccessfulBuildMeta);
|
|
2118
2113
|
write(this._forceBuild);
|
|
2119
|
-
write(this._codeGeneratorData);
|
|
2120
2114
|
write(this.hot);
|
|
2121
2115
|
super.serialize(context);
|
|
2122
2116
|
}
|
|
@@ -2160,7 +2154,6 @@ class NormalModule extends Module {
|
|
|
2160
2154
|
this.error = read();
|
|
2161
2155
|
this._lastSuccessfulBuildMeta = read();
|
|
2162
2156
|
this._forceBuild = read();
|
|
2163
|
-
this._codeGeneratorData = read();
|
|
2164
2157
|
this.hot = read();
|
|
2165
2158
|
super.deserialize(context);
|
|
2166
2159
|
}
|
package/lib/RuntimePlugin.js
CHANGED
|
@@ -189,6 +189,9 @@ const TREE_DEPENDENCIES = {
|
|
|
189
189
|
RuntimeGlobals.makeNamespaceObject,
|
|
190
190
|
RuntimeGlobals.require
|
|
191
191
|
],
|
|
192
|
+
[RuntimeGlobals.deferredModuleAsyncTransitiveDependencies]: [
|
|
193
|
+
RuntimeGlobals.asyncModule
|
|
194
|
+
],
|
|
192
195
|
[RuntimeGlobals.makeOptimizedDeferredNamespaceObject]: [
|
|
193
196
|
RuntimeGlobals.require
|
|
194
197
|
],
|