webpack 4.3.0 → 4.4.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/bin/webpack.js +69 -10
- package/lib/APIPlugin.js +2 -2
- package/lib/AmdMainTemplatePlugin.js +4 -6
- package/lib/AsyncDependencyToInitialChunkError.js +1 -3
- package/lib/Compilation.js +8 -4
- package/lib/Compiler.js +7 -10
- package/lib/ContextModule.js +19 -7
- package/lib/DefinePlugin.js +2 -2
- package/lib/Dependency.js +53 -52
- package/lib/EnvironmentPlugin.js +1 -3
- package/lib/ExternalModule.js +3 -3
- package/lib/HotUpdateChunkTemplate.js +1 -1
- package/lib/JavascriptGenerator.js +7 -7
- package/lib/JavascriptModulesPlugin.js +6 -6
- package/lib/MainTemplate.js +2 -2
- package/lib/Module.js +343 -340
- package/lib/ModuleFilenameHelpers.js +1 -1
- package/lib/MultiModule.js +4 -1
- package/lib/NoModeWarning.js +23 -21
- package/lib/NormalModule.js +9 -0
- package/lib/NormalModuleFactory.js +1 -1
- package/lib/Parser.js +7 -3
- package/lib/ProgressPlugin.js +231 -231
- package/lib/RecordIdsPlugin.js +2 -2
- package/lib/RuntimeTemplate.js +15 -45
- package/lib/Stats.js +2 -0
- package/lib/Template.js +1 -1
- package/lib/TemplatedPathPlugin.js +1 -3
- package/lib/UmdMainTemplatePlugin.js +41 -45
- package/lib/WebAssemblyParser.js +1 -5
- package/lib/WebpackOptionsApply.js +2 -2
- package/lib/WebpackOptionsDefaulter.js +10 -8
- package/lib/WebpackOptionsValidationError.js +6 -8
- package/lib/dependencies/AMDDefineDependencyParserPlugin.js +13 -13
- package/lib/dependencies/AMDRequireDependenciesBlockParserPlugin.js +1 -1
- package/lib/dependencies/HarmonyExportImportedSpecifierDependency.js +5 -11
- package/lib/dependencies/HarmonyExportSpecifierDependency.js +3 -3
- package/lib/dependencies/HarmonyImportSpecifierDependency.js +4 -6
- package/lib/dependencies/ImportParserPlugin.js +2 -6
- package/lib/dependencies/RequireIncludeDependency.js +1 -1
- package/lib/dependencies/WebpackMissingModule.js +1 -3
- package/lib/node/ReadFileCompileWasmMainTemplatePlugin.js +1 -3
- package/lib/optimize/ConcatenatedModule.js +19 -20
- package/lib/optimize/SplitChunksPlugin.js +30 -14
- package/lib/performance/SizeLimitsPlugin.js +105 -105
- package/lib/web/JsonpChunkTemplatePlugin.js +5 -5
- package/lib/web/JsonpMainTemplatePlugin.js +2 -2
- package/package.json +7 -6
- package/schemas/WebpackOptions.json +23 -16
- package/schemas/ajv.absolutePath.js +1 -1
package/lib/Module.js
CHANGED
@@ -1,340 +1,343 @@
|
|
1
|
-
/*
|
2
|
-
MIT License http://www.opensource.org/licenses/mit-license.php
|
3
|
-
Author Tobias Koppers @sokra
|
4
|
-
*/
|
5
|
-
"use strict";
|
6
|
-
|
7
|
-
const util = require("util");
|
8
|
-
|
9
|
-
const DependenciesBlock = require("./DependenciesBlock");
|
10
|
-
const ModuleReason = require("./ModuleReason");
|
11
|
-
const SortableSet = require("./util/SortableSet");
|
12
|
-
const Template = require("./Template");
|
13
|
-
|
14
|
-
const EMPTY_RESOLVE_OPTIONS = {};
|
15
|
-
|
16
|
-
let debugId = 1000;
|
17
|
-
|
18
|
-
const sortById = (a, b) => {
|
19
|
-
return a.id - b.id;
|
20
|
-
};
|
21
|
-
|
22
|
-
const sortByDebugId = (a, b) => {
|
23
|
-
return a.debugId - b.debugId;
|
24
|
-
};
|
25
|
-
|
26
|
-
class Module extends DependenciesBlock {
|
27
|
-
constructor(type, context = null) {
|
28
|
-
super();
|
29
|
-
this.type = type;
|
30
|
-
this.context = context;
|
31
|
-
|
32
|
-
// Unique Id
|
33
|
-
this.debugId = debugId++;
|
34
|
-
|
35
|
-
// Hash
|
36
|
-
this.hash = undefined;
|
37
|
-
this.renderedHash = undefined;
|
38
|
-
|
39
|
-
// Info from Factory
|
40
|
-
this.resolveOptions = EMPTY_RESOLVE_OPTIONS;
|
41
|
-
this.factoryMeta = {};
|
42
|
-
|
43
|
-
// Info from Build
|
44
|
-
this.warnings = [];
|
45
|
-
this.errors = [];
|
46
|
-
this.buildMeta = undefined;
|
47
|
-
this.buildInfo = undefined;
|
48
|
-
|
49
|
-
// Graph (per Compilation)
|
50
|
-
this.reasons = [];
|
51
|
-
this._chunks = new SortableSet(undefined, sortById);
|
52
|
-
|
53
|
-
// Info from Compilation (per Compilation)
|
54
|
-
this.id = null;
|
55
|
-
this.index = null;
|
56
|
-
this.index2 = null;
|
57
|
-
this.depth = null;
|
58
|
-
this.issuer = null;
|
59
|
-
this.profile = undefined;
|
60
|
-
this.prefetched = false;
|
61
|
-
this.built = false;
|
62
|
-
|
63
|
-
// Info from Optimization (per Compilation)
|
64
|
-
this.used = null;
|
65
|
-
this.usedExports = null;
|
66
|
-
this.optimizationBailout = [];
|
67
|
-
|
68
|
-
// delayed operations
|
69
|
-
this._rewriteChunkInReasons = undefined;
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
this.
|
85
|
-
|
86
|
-
this.
|
87
|
-
|
88
|
-
this.
|
89
|
-
|
90
|
-
this.
|
91
|
-
this.
|
92
|
-
this.
|
93
|
-
this.
|
94
|
-
this.
|
95
|
-
this.
|
96
|
-
|
97
|
-
this.
|
98
|
-
|
99
|
-
this.
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
this.
|
107
|
-
this.
|
108
|
-
this.
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
return
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
otherModule._chunks.
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
this._rewriteChunkInReasons
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
this._rewriteChunkInReasons
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
if (!this.used
|
226
|
-
if (
|
227
|
-
if (this.
|
228
|
-
|
229
|
-
if (
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
if (
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
this.
|
281
|
-
this.
|
282
|
-
this.
|
283
|
-
this.
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
Module.prototype.
|
336
|
-
Module.prototype.
|
337
|
-
Module.prototype.
|
338
|
-
Module.prototype.
|
339
|
-
|
340
|
-
|
1
|
+
/*
|
2
|
+
MIT License http://www.opensource.org/licenses/mit-license.php
|
3
|
+
Author Tobias Koppers @sokra
|
4
|
+
*/
|
5
|
+
"use strict";
|
6
|
+
|
7
|
+
const util = require("util");
|
8
|
+
|
9
|
+
const DependenciesBlock = require("./DependenciesBlock");
|
10
|
+
const ModuleReason = require("./ModuleReason");
|
11
|
+
const SortableSet = require("./util/SortableSet");
|
12
|
+
const Template = require("./Template");
|
13
|
+
|
14
|
+
const EMPTY_RESOLVE_OPTIONS = {};
|
15
|
+
|
16
|
+
let debugId = 1000;
|
17
|
+
|
18
|
+
const sortById = (a, b) => {
|
19
|
+
return a.id - b.id;
|
20
|
+
};
|
21
|
+
|
22
|
+
const sortByDebugId = (a, b) => {
|
23
|
+
return a.debugId - b.debugId;
|
24
|
+
};
|
25
|
+
|
26
|
+
class Module extends DependenciesBlock {
|
27
|
+
constructor(type, context = null) {
|
28
|
+
super();
|
29
|
+
this.type = type;
|
30
|
+
this.context = context;
|
31
|
+
|
32
|
+
// Unique Id
|
33
|
+
this.debugId = debugId++;
|
34
|
+
|
35
|
+
// Hash
|
36
|
+
this.hash = undefined;
|
37
|
+
this.renderedHash = undefined;
|
38
|
+
|
39
|
+
// Info from Factory
|
40
|
+
this.resolveOptions = EMPTY_RESOLVE_OPTIONS;
|
41
|
+
this.factoryMeta = {};
|
42
|
+
|
43
|
+
// Info from Build
|
44
|
+
this.warnings = [];
|
45
|
+
this.errors = [];
|
46
|
+
this.buildMeta = undefined;
|
47
|
+
this.buildInfo = undefined;
|
48
|
+
|
49
|
+
// Graph (per Compilation)
|
50
|
+
this.reasons = [];
|
51
|
+
this._chunks = new SortableSet(undefined, sortById);
|
52
|
+
|
53
|
+
// Info from Compilation (per Compilation)
|
54
|
+
this.id = null;
|
55
|
+
this.index = null;
|
56
|
+
this.index2 = null;
|
57
|
+
this.depth = null;
|
58
|
+
this.issuer = null;
|
59
|
+
this.profile = undefined;
|
60
|
+
this.prefetched = false;
|
61
|
+
this.built = false;
|
62
|
+
|
63
|
+
// Info from Optimization (per Compilation)
|
64
|
+
this.used = null;
|
65
|
+
this.usedExports = null;
|
66
|
+
this.optimizationBailout = [];
|
67
|
+
|
68
|
+
// delayed operations
|
69
|
+
this._rewriteChunkInReasons = undefined;
|
70
|
+
|
71
|
+
this.useSourceMap = false;
|
72
|
+
}
|
73
|
+
|
74
|
+
get exportsArgument() {
|
75
|
+
return (this.buildInfo && this.buildInfo.exportsArgument) || "exports";
|
76
|
+
}
|
77
|
+
|
78
|
+
get moduleArgument() {
|
79
|
+
return (this.buildInfo && this.buildInfo.moduleArgument) || "module";
|
80
|
+
}
|
81
|
+
|
82
|
+
disconnect() {
|
83
|
+
this.hash = undefined;
|
84
|
+
this.renderedHash = undefined;
|
85
|
+
|
86
|
+
this.reasons.length = 0;
|
87
|
+
this._rewriteChunkInReasons = undefined;
|
88
|
+
this._chunks.clear();
|
89
|
+
|
90
|
+
this.id = null;
|
91
|
+
this.index = null;
|
92
|
+
this.index2 = null;
|
93
|
+
this.depth = null;
|
94
|
+
this.issuer = null;
|
95
|
+
this.profile = undefined;
|
96
|
+
this.prefetched = false;
|
97
|
+
this.built = false;
|
98
|
+
|
99
|
+
this.used = null;
|
100
|
+
this.usedExports = null;
|
101
|
+
this.optimizationBailout.length = 0;
|
102
|
+
super.disconnect();
|
103
|
+
}
|
104
|
+
|
105
|
+
unseal() {
|
106
|
+
this.id = null;
|
107
|
+
this.index = null;
|
108
|
+
this.index2 = null;
|
109
|
+
this.depth = null;
|
110
|
+
this._chunks.clear();
|
111
|
+
super.unseal();
|
112
|
+
}
|
113
|
+
|
114
|
+
setChunks(chunks) {
|
115
|
+
this._chunks = new SortableSet(chunks, sortById);
|
116
|
+
}
|
117
|
+
|
118
|
+
addChunk(chunk) {
|
119
|
+
if (this._chunks.has(chunk)) return false;
|
120
|
+
this._chunks.add(chunk);
|
121
|
+
return true;
|
122
|
+
}
|
123
|
+
|
124
|
+
removeChunk(chunk) {
|
125
|
+
if (this._chunks.delete(chunk)) {
|
126
|
+
chunk.removeModule(this);
|
127
|
+
return true;
|
128
|
+
}
|
129
|
+
return false;
|
130
|
+
}
|
131
|
+
|
132
|
+
isInChunk(chunk) {
|
133
|
+
return this._chunks.has(chunk);
|
134
|
+
}
|
135
|
+
|
136
|
+
isEntryModule() {
|
137
|
+
for (const chunk of this._chunks) {
|
138
|
+
if (chunk.entryModule === this) return true;
|
139
|
+
}
|
140
|
+
return false;
|
141
|
+
}
|
142
|
+
|
143
|
+
get optional() {
|
144
|
+
return (
|
145
|
+
this.reasons.length > 0 &&
|
146
|
+
this.reasons.every(r => r.dependency && r.dependency.optional)
|
147
|
+
);
|
148
|
+
}
|
149
|
+
|
150
|
+
getChunks() {
|
151
|
+
return Array.from(this._chunks);
|
152
|
+
}
|
153
|
+
|
154
|
+
getNumberOfChunks() {
|
155
|
+
return this._chunks.size;
|
156
|
+
}
|
157
|
+
|
158
|
+
get chunksIterable() {
|
159
|
+
return this._chunks;
|
160
|
+
}
|
161
|
+
|
162
|
+
hasEqualsChunks(otherModule) {
|
163
|
+
if (this._chunks.size !== otherModule._chunks.size) return false;
|
164
|
+
this._chunks.sortWith(sortByDebugId);
|
165
|
+
otherModule._chunks.sortWith(sortByDebugId);
|
166
|
+
const a = this._chunks[Symbol.iterator]();
|
167
|
+
const b = otherModule._chunks[Symbol.iterator]();
|
168
|
+
// eslint-disable-next-line no-constant-condition
|
169
|
+
while (true) {
|
170
|
+
const aItem = a.next();
|
171
|
+
const bItem = b.next();
|
172
|
+
if (aItem.done) return true;
|
173
|
+
if (aItem.value !== bItem.value) return false;
|
174
|
+
}
|
175
|
+
}
|
176
|
+
|
177
|
+
addReason(module, dependency, explanation) {
|
178
|
+
this.reasons.push(new ModuleReason(module, dependency, explanation));
|
179
|
+
}
|
180
|
+
|
181
|
+
removeReason(module, dependency) {
|
182
|
+
for (let i = 0; i < this.reasons.length; i++) {
|
183
|
+
let r = this.reasons[i];
|
184
|
+
if (r.module === module && r.dependency === dependency) {
|
185
|
+
this.reasons.splice(i, 1);
|
186
|
+
return true;
|
187
|
+
}
|
188
|
+
}
|
189
|
+
return false;
|
190
|
+
}
|
191
|
+
|
192
|
+
hasReasonForChunk(chunk) {
|
193
|
+
if (this._rewriteChunkInReasons) {
|
194
|
+
for (const operation of this._rewriteChunkInReasons)
|
195
|
+
this._doRewriteChunkInReasons(operation.oldChunk, operation.newChunks);
|
196
|
+
this._rewriteChunkInReasons = undefined;
|
197
|
+
}
|
198
|
+
for (let i = 0; i < this.reasons.length; i++) {
|
199
|
+
if (this.reasons[i].hasChunk(chunk)) return true;
|
200
|
+
}
|
201
|
+
return false;
|
202
|
+
}
|
203
|
+
|
204
|
+
hasReasons() {
|
205
|
+
return this.reasons.length > 0;
|
206
|
+
}
|
207
|
+
|
208
|
+
rewriteChunkInReasons(oldChunk, newChunks) {
|
209
|
+
// This is expensive. Delay operation until we really need the data
|
210
|
+
if (this._rewriteChunkInReasons === undefined)
|
211
|
+
this._rewriteChunkInReasons = [];
|
212
|
+
this._rewriteChunkInReasons.push({
|
213
|
+
oldChunk,
|
214
|
+
newChunks
|
215
|
+
});
|
216
|
+
}
|
217
|
+
|
218
|
+
_doRewriteChunkInReasons(oldChunk, newChunks) {
|
219
|
+
for (let i = 0; i < this.reasons.length; i++) {
|
220
|
+
this.reasons[i].rewriteChunks(oldChunk, newChunks);
|
221
|
+
}
|
222
|
+
}
|
223
|
+
|
224
|
+
isUsed(exportName) {
|
225
|
+
if (!exportName) return this.used !== false;
|
226
|
+
if (this.used === null || this.usedExports === null) return exportName;
|
227
|
+
if (!this.used) return false;
|
228
|
+
if (!this.usedExports) return false;
|
229
|
+
if (this.usedExports === true) return exportName;
|
230
|
+
let idx = this.usedExports.indexOf(exportName);
|
231
|
+
if (idx < 0) return false;
|
232
|
+
|
233
|
+
// Mangle export name if possible
|
234
|
+
if (this.isProvided(exportName)) {
|
235
|
+
if (this.buildMeta.exportsType === "namespace")
|
236
|
+
return Template.numberToIdentifer(idx);
|
237
|
+
else if (
|
238
|
+
this.buildMeta.exportsType === "named" &&
|
239
|
+
!this.usedExports.includes("default")
|
240
|
+
)
|
241
|
+
return Template.numberToIdentifer(idx);
|
242
|
+
}
|
243
|
+
return exportName;
|
244
|
+
}
|
245
|
+
|
246
|
+
isProvided(exportName) {
|
247
|
+
if (!Array.isArray(this.buildMeta.providedExports)) return null;
|
248
|
+
return this.buildMeta.providedExports.includes(exportName);
|
249
|
+
}
|
250
|
+
|
251
|
+
toString() {
|
252
|
+
return `Module[${this.id || this.debugId}]`;
|
253
|
+
}
|
254
|
+
|
255
|
+
needRebuild(fileTimestamps, contextTimestamps) {
|
256
|
+
return true;
|
257
|
+
}
|
258
|
+
|
259
|
+
updateHash(hash) {
|
260
|
+
hash.update(`${this.id}`);
|
261
|
+
hash.update(JSON.stringify(this.usedExports));
|
262
|
+
super.updateHash(hash);
|
263
|
+
}
|
264
|
+
|
265
|
+
sortItems(sortChunks) {
|
266
|
+
super.sortItems();
|
267
|
+
if (sortChunks) this._chunks.sort();
|
268
|
+
this.reasons.sort((a, b) => {
|
269
|
+
if (a.module === b.module) return 0;
|
270
|
+
if (!a.module) return -1;
|
271
|
+
if (!b.module) return 1;
|
272
|
+
return sortById(a.module, b.module);
|
273
|
+
});
|
274
|
+
if (Array.isArray(this.usedExports)) {
|
275
|
+
this.usedExports.sort();
|
276
|
+
}
|
277
|
+
}
|
278
|
+
|
279
|
+
unbuild() {
|
280
|
+
this.dependencies.length = 0;
|
281
|
+
this.blocks.length = 0;
|
282
|
+
this.variables.length = 0;
|
283
|
+
this.buildMeta = undefined;
|
284
|
+
this.buildInfo = undefined;
|
285
|
+
this.disconnect();
|
286
|
+
}
|
287
|
+
|
288
|
+
get arguments() {
|
289
|
+
throw new Error("Module.arguments was removed, there is no replacement.");
|
290
|
+
}
|
291
|
+
|
292
|
+
set arguments(value) {
|
293
|
+
throw new Error("Module.arguments was removed, there is no replacement.");
|
294
|
+
}
|
295
|
+
}
|
296
|
+
|
297
|
+
// TODO remove in webpack 5
|
298
|
+
Object.defineProperty(Module.prototype, "forEachChunk", {
|
299
|
+
configurable: false,
|
300
|
+
value: util.deprecate(function(fn) {
|
301
|
+
this._chunks.forEach(fn);
|
302
|
+
}, "Module.forEachChunk: Use for(const chunk of module.chunksIterable) instead")
|
303
|
+
});
|
304
|
+
|
305
|
+
// TODO remove in webpack 5
|
306
|
+
Object.defineProperty(Module.prototype, "mapChunks", {
|
307
|
+
configurable: false,
|
308
|
+
value: util.deprecate(function(fn) {
|
309
|
+
return Array.from(this._chunks, fn);
|
310
|
+
}, "Module.mapChunks: Use Array.from(module.chunksIterable, fn) instead")
|
311
|
+
});
|
312
|
+
|
313
|
+
// TODO remove in webpack 5
|
314
|
+
Object.defineProperty(Module.prototype, "entry", {
|
315
|
+
configurable: false,
|
316
|
+
get() {
|
317
|
+
throw new Error("Module.entry was removed. Use Chunk.entryModule");
|
318
|
+
},
|
319
|
+
set() {
|
320
|
+
throw new Error("Module.entry was removed. Use Chunk.entryModule");
|
321
|
+
}
|
322
|
+
});
|
323
|
+
|
324
|
+
// TODO remove in webpack 5
|
325
|
+
Object.defineProperty(Module.prototype, "meta", {
|
326
|
+
configurable: false,
|
327
|
+
get: util.deprecate(function() {
|
328
|
+
return this.buildMeta;
|
329
|
+
}, "Module.meta was renamed to Module.buildMeta"),
|
330
|
+
set: util.deprecate(function(value) {
|
331
|
+
this.buildMeta = value;
|
332
|
+
}, "Module.meta was renamed to Module.buildMeta")
|
333
|
+
});
|
334
|
+
|
335
|
+
Module.prototype.identifier = null;
|
336
|
+
Module.prototype.readableIdentifier = null;
|
337
|
+
Module.prototype.build = null;
|
338
|
+
Module.prototype.source = null;
|
339
|
+
Module.prototype.size = null;
|
340
|
+
Module.prototype.nameForCondition = null;
|
341
|
+
Module.prototype.updateCacheModule = null;
|
342
|
+
|
343
|
+
module.exports = Module;
|