webpack 4.1.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/README.md +719 -721
- package/bin/webpack.js +69 -10
- package/lib/APIPlugin.js +84 -84
- package/lib/AmdMainTemplatePlugin.js +75 -77
- package/lib/AsyncDependencyToInitialChunkError.js +21 -23
- package/lib/BannerPlugin.js +101 -101
- package/lib/Chunk.js +477 -469
- package/lib/ChunkTemplate.js +51 -53
- package/lib/Compilation.js +1858 -1851
- package/lib/Compiler.js +493 -478
- package/lib/ConcurrentCompilationError.js +19 -0
- package/lib/ContextModule.js +696 -685
- package/lib/ContextModuleFactory.js +245 -243
- package/lib/DefinePlugin.js +197 -197
- package/lib/DelegatedModule.js +101 -101
- package/lib/DependenciesBlockVariable.js +51 -52
- package/lib/Dependency.js +53 -52
- package/lib/DllModule.js +54 -54
- package/lib/DllModuleFactory.js +29 -29
- package/lib/EnvironmentPlugin.js +65 -67
- package/lib/EvalDevToolModuleTemplatePlugin.js +60 -60
- package/lib/EvalSourceMapDevToolModuleTemplatePlugin.js +105 -105
- package/lib/ExportPropertyMainTemplatePlugin.js +40 -40
- package/lib/ExternalModule.js +159 -159
- package/lib/FunctionModuleTemplatePlugin.js +98 -98
- package/lib/HotModuleReplacement.runtime.js +631 -631
- package/lib/HotModuleReplacementPlugin.js +407 -406
- package/lib/HotUpdateChunkTemplate.js +78 -80
- package/lib/JavascriptGenerator.js +228 -229
- package/lib/JavascriptModulesPlugin.js +184 -158
- package/lib/JsonGenerator.js +42 -42
- package/lib/MainTemplate.js +406 -402
- package/lib/Module.js +343 -340
- package/lib/ModuleBuildError.js +42 -42
- package/lib/ModuleError.js +28 -28
- package/lib/ModuleFilenameHelpers.js +166 -166
- package/lib/ModuleTemplate.js +77 -79
- package/lib/ModuleWarning.js +30 -30
- package/lib/MultiCompiler.js +271 -259
- package/lib/MultiModule.js +78 -75
- package/lib/MultiModuleFactory.js +23 -23
- package/lib/MultiWatching.js +38 -37
- package/lib/NoModeWarning.js +23 -21
- package/lib/NormalModule.js +478 -470
- package/lib/NormalModuleFactory.js +483 -481
- package/lib/OptionsDefaulter.js +80 -86
- package/lib/Parser.js +2074 -2071
- package/lib/ProgressPlugin.js +231 -231
- package/lib/RawModule.js +54 -55
- package/lib/RecordIdsPlugin.js +160 -160
- package/lib/RemovedPluginError.js +13 -13
- package/lib/ResolverFactory.js +64 -67
- package/lib/RuntimeTemplate.js +267 -297
- package/lib/SetVarMainTemplatePlugin.js +57 -57
- package/lib/SourceMapDevToolPlugin.js +302 -308
- package/lib/Stats.js +1234 -1212
- package/lib/Template.js +205 -205
- package/lib/TemplatedPathPlugin.js +170 -143
- package/lib/UmdMainTemplatePlugin.js +264 -269
- package/lib/Watching.js +193 -193
- package/lib/WebAssemblyParser.js +50 -54
- package/lib/WebpackOptionsApply.js +401 -401
- package/lib/WebpackOptionsDefaulter.js +337 -317
- package/lib/WebpackOptionsValidationError.js +316 -319
- package/lib/debug/ProfilingPlugin.js +409 -405
- package/lib/dependencies/AMDDefineDependencyParserPlugin.js +328 -311
- package/lib/dependencies/AMDRequireContextDependency.js +20 -20
- package/lib/dependencies/AMDRequireDependenciesBlockParserPlugin.js +270 -241
- package/lib/dependencies/HarmonyAcceptImportDependency.js +23 -23
- package/lib/dependencies/HarmonyExportImportedSpecifierDependency.js +620 -606
- package/lib/dependencies/HarmonyExportSpecifierDependency.js +53 -53
- package/lib/dependencies/HarmonyImportDependencyParserPlugin.js +214 -214
- package/lib/dependencies/HarmonyImportSpecifierDependency.js +154 -156
- package/lib/dependencies/ImportDependenciesBlock.js +17 -17
- package/lib/dependencies/ImportDependency.js +34 -34
- package/lib/dependencies/ImportEagerDependency.js +32 -32
- package/lib/dependencies/ImportParserPlugin.js +175 -179
- package/lib/dependencies/ImportWeakDependency.js +34 -34
- package/lib/dependencies/JsonExportsDependency.js +25 -25
- package/lib/dependencies/ModuleDependency.js +20 -20
- package/lib/dependencies/NullDependency.js +20 -20
- package/lib/dependencies/RequireContextDependency.js +22 -22
- package/lib/dependencies/RequireIncludeDependency.js +40 -40
- package/lib/dependencies/WebpackMissingModule.js +20 -22
- package/lib/node/NodeChunkTemplatePlugin.js +31 -31
- package/lib/node/NodeHotUpdateChunkTemplatePlugin.js +36 -36
- package/lib/node/NodeMainTemplatePlugin.js +320 -273
- package/lib/node/ReadFileCompileWasmMainTemplatePlugin.js +113 -115
- package/lib/optimize/AggressiveSplittingPlugin.js +281 -281
- package/lib/optimize/ConcatenatedModule.js +1364 -1366
- package/lib/optimize/RemoveParentModulesPlugin.js +114 -114
- package/lib/optimize/SplitChunksPlugin.js +519 -491
- package/lib/performance/SizeLimitsPlugin.js +105 -105
- package/lib/util/TrackingSet.js +35 -35
- package/lib/util/objectToMap.js +10 -10
- package/lib/wasm/WasmModuleTemplatePlugin.js +106 -106
- package/lib/web/JsonpChunkTemplatePlugin.js +47 -47
- package/lib/web/JsonpExportMainTemplatePlugin.js +47 -47
- package/lib/web/JsonpHotUpdateChunkTemplatePlugin.js +39 -39
- package/lib/web/JsonpMainTemplatePlugin.js +425 -403
- package/lib/webpack.js +182 -179
- package/lib/webworker/WebWorkerChunkTemplatePlugin.js +35 -35
- package/lib/webworker/WebWorkerHotUpdateChunkTemplatePlugin.js +40 -40
- package/lib/webworker/WebWorkerMainTemplatePlugin.js +177 -154
- package/package.json +9 -8
- package/schemas/WebpackOptions.json +1973 -1951
- package/schemas/ajv.absolutePath.js +55 -29
- package/schemas/plugins/BannerPlugin.json +85 -85
- package/schemas/plugins/DllPlugin.json +28 -28
- package/schemas/plugins/DllReferencePlugin.json +99 -99
- package/schemas/plugins/HashedModuleIdsPlugin.json +24 -24
- package/schemas/plugins/LoaderOptionsPlugin.json +26 -26
- package/schemas/plugins/SourceMapDevToolPlugin.json +187 -187
- package/schemas/plugins/WatchIgnorePlugin.json +16 -16
- package/schemas/plugins/debug/ProfilingPlugin.json +12 -12
- package/schemas/plugins/optimize/AggressiveSplittingPlugin.json +22 -22
- package/schemas/plugins/optimize/LimitChunkCountPlugin.json +15 -15
- package/schemas/plugins/optimize/MinChunkSizePlugin.json +13 -13
@@ -1,269 +1,264 @@
|
|
1
|
-
/*
|
2
|
-
MIT License http://www.opensource.org/licenses/mit-license.php
|
3
|
-
Author Tobias Koppers @sokra
|
4
|
-
*/
|
5
|
-
"use strict";
|
6
|
-
|
7
|
-
const ConcatSource = require("webpack-sources")
|
8
|
-
const
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
this.
|
30
|
-
|
31
|
-
|
32
|
-
this.
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
this.
|
40
|
-
this.
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
.
|
50
|
-
|
51
|
-
|
52
|
-
m.
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
)
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
let
|
106
|
-
|
107
|
-
if (typeof request === "
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
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
|
-
(
|
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
|
-
|
195
|
-
|
196
|
-
|
197
|
-
"
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
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
|
-
module.exports = UmdMainTemplatePlugin;
|
1
|
+
/*
|
2
|
+
MIT License http://www.opensource.org/licenses/mit-license.php
|
3
|
+
Author Tobias Koppers @sokra
|
4
|
+
*/
|
5
|
+
"use strict";
|
6
|
+
|
7
|
+
const { ConcatSource, OriginalSource } = require("webpack-sources");
|
8
|
+
const Template = require("./Template");
|
9
|
+
|
10
|
+
function accessorToObjectAccess(accessor) {
|
11
|
+
return accessor.map(a => `[${JSON.stringify(a)}]`).join("");
|
12
|
+
}
|
13
|
+
|
14
|
+
function accessorAccess(base, accessor) {
|
15
|
+
accessor = [].concat(accessor);
|
16
|
+
return accessor
|
17
|
+
.map((a, idx) => {
|
18
|
+
a = base + accessorToObjectAccess(accessor.slice(0, idx + 1));
|
19
|
+
if (idx === accessor.length - 1) return a;
|
20
|
+
return `${a} = ${a} || {}`;
|
21
|
+
})
|
22
|
+
.join(", ");
|
23
|
+
}
|
24
|
+
|
25
|
+
class UmdMainTemplatePlugin {
|
26
|
+
constructor(name, options) {
|
27
|
+
if (typeof name === "object" && !Array.isArray(name)) {
|
28
|
+
this.name = name.root || name.amd || name.commonjs;
|
29
|
+
this.names = name;
|
30
|
+
} else {
|
31
|
+
this.name = name;
|
32
|
+
this.names = {
|
33
|
+
commonjs: name,
|
34
|
+
root: name,
|
35
|
+
amd: name
|
36
|
+
};
|
37
|
+
}
|
38
|
+
this.optionalAmdExternalAsGlobal = options.optionalAmdExternalAsGlobal;
|
39
|
+
this.namedDefine = options.namedDefine;
|
40
|
+
this.auxiliaryComment = options.auxiliaryComment;
|
41
|
+
}
|
42
|
+
|
43
|
+
apply(compilation) {
|
44
|
+
const { mainTemplate, chunkTemplate, runtimeTemplate } = compilation;
|
45
|
+
|
46
|
+
const onRenderWithEntry = (source, chunk, hash) => {
|
47
|
+
let externals = chunk
|
48
|
+
.getModules()
|
49
|
+
.filter(
|
50
|
+
m =>
|
51
|
+
m.external &&
|
52
|
+
(m.externalType === "umd" || m.externalType === "umd2")
|
53
|
+
);
|
54
|
+
const optionalExternals = [];
|
55
|
+
let requiredExternals = [];
|
56
|
+
if (this.optionalAmdExternalAsGlobal) {
|
57
|
+
for (const m of externals) {
|
58
|
+
if (m.optional) {
|
59
|
+
optionalExternals.push(m);
|
60
|
+
} else {
|
61
|
+
requiredExternals.push(m);
|
62
|
+
}
|
63
|
+
}
|
64
|
+
externals = requiredExternals.concat(optionalExternals);
|
65
|
+
} else {
|
66
|
+
requiredExternals = externals;
|
67
|
+
}
|
68
|
+
|
69
|
+
function replaceKeys(str) {
|
70
|
+
return mainTemplate.getAssetPath(str, {
|
71
|
+
hash,
|
72
|
+
chunk
|
73
|
+
});
|
74
|
+
}
|
75
|
+
|
76
|
+
function externalsDepsArray(modules) {
|
77
|
+
return `[${replaceKeys(
|
78
|
+
modules
|
79
|
+
.map(m =>
|
80
|
+
JSON.stringify(
|
81
|
+
typeof m.request === "object" ? m.request.amd : m.request
|
82
|
+
)
|
83
|
+
)
|
84
|
+
.join(", ")
|
85
|
+
)}]`;
|
86
|
+
}
|
87
|
+
|
88
|
+
function externalsRootArray(modules) {
|
89
|
+
return replaceKeys(
|
90
|
+
modules
|
91
|
+
.map(m => {
|
92
|
+
let request = m.request;
|
93
|
+
if (typeof request === "object") request = request.root;
|
94
|
+
return `root${accessorToObjectAccess([].concat(request))}`;
|
95
|
+
})
|
96
|
+
.join(", ")
|
97
|
+
);
|
98
|
+
}
|
99
|
+
|
100
|
+
function externalsRequireArray(type) {
|
101
|
+
return replaceKeys(
|
102
|
+
externals
|
103
|
+
.map(m => {
|
104
|
+
let expr;
|
105
|
+
let request = m.request;
|
106
|
+
if (typeof request === "object") request = request[type];
|
107
|
+
if (typeof request === "undefined")
|
108
|
+
throw new Error(
|
109
|
+
"Missing external configuration for type:" + type
|
110
|
+
);
|
111
|
+
if (Array.isArray(request)) {
|
112
|
+
expr = `require(${JSON.stringify(
|
113
|
+
request[0]
|
114
|
+
)})${accessorToObjectAccess(request.slice(1))}`;
|
115
|
+
} else expr = `require(${JSON.stringify(request)})`;
|
116
|
+
if (m.optional) {
|
117
|
+
expr = `(function webpackLoadOptionalExternalModule() { try { return ${expr}; } catch(e) {} }())`;
|
118
|
+
}
|
119
|
+
return expr;
|
120
|
+
})
|
121
|
+
.join(", ")
|
122
|
+
);
|
123
|
+
}
|
124
|
+
|
125
|
+
function externalsArguments(modules) {
|
126
|
+
return modules
|
127
|
+
.map(
|
128
|
+
m =>
|
129
|
+
`__WEBPACK_EXTERNAL_MODULE_${Template.toIdentifier(`${m.id}`)}__`
|
130
|
+
)
|
131
|
+
.join(", ");
|
132
|
+
}
|
133
|
+
|
134
|
+
function libraryName(library) {
|
135
|
+
return JSON.stringify(replaceKeys([].concat(library).pop()));
|
136
|
+
}
|
137
|
+
|
138
|
+
let amdFactory;
|
139
|
+
if (optionalExternals.length > 0) {
|
140
|
+
const wrapperArguments = externalsArguments(requiredExternals);
|
141
|
+
const factoryArguments =
|
142
|
+
requiredExternals.length > 0
|
143
|
+
? externalsArguments(requiredExternals) +
|
144
|
+
", " +
|
145
|
+
externalsRootArray(optionalExternals)
|
146
|
+
: externalsRootArray(optionalExternals);
|
147
|
+
amdFactory =
|
148
|
+
`function webpackLoadOptionalExternalModuleAmd(${wrapperArguments}) {\n` +
|
149
|
+
` return factory(${factoryArguments});\n` +
|
150
|
+
" }";
|
151
|
+
} else {
|
152
|
+
amdFactory = "factory";
|
153
|
+
}
|
154
|
+
|
155
|
+
return new ConcatSource(
|
156
|
+
new OriginalSource(
|
157
|
+
"(function webpackUniversalModuleDefinition(root, factory) {\n" +
|
158
|
+
(this.auxiliaryComment && typeof this.auxiliaryComment === "string"
|
159
|
+
? " //" + this.auxiliaryComment + "\n"
|
160
|
+
: this.auxiliaryComment.commonjs2
|
161
|
+
? " //" + this.auxiliaryComment.commonjs2 + "\n"
|
162
|
+
: "") +
|
163
|
+
" if(typeof exports === 'object' && typeof module === 'object')\n" +
|
164
|
+
" module.exports = factory(" +
|
165
|
+
externalsRequireArray("commonjs2") +
|
166
|
+
");\n" +
|
167
|
+
(this.auxiliaryComment && typeof this.auxiliaryComment === "string"
|
168
|
+
? " //" + this.auxiliaryComment + "\n"
|
169
|
+
: this.auxiliaryComment.amd
|
170
|
+
? " //" + this.auxiliaryComment.amd + "\n"
|
171
|
+
: "") +
|
172
|
+
" else if(typeof define === 'function' && define.amd)\n" +
|
173
|
+
(requiredExternals.length > 0
|
174
|
+
? this.names.amd && this.namedDefine === true
|
175
|
+
? " define(" +
|
176
|
+
libraryName(this.names.amd) +
|
177
|
+
", " +
|
178
|
+
externalsDepsArray(requiredExternals) +
|
179
|
+
", " +
|
180
|
+
amdFactory +
|
181
|
+
");\n"
|
182
|
+
: " define(" +
|
183
|
+
externalsDepsArray(requiredExternals) +
|
184
|
+
", " +
|
185
|
+
amdFactory +
|
186
|
+
");\n"
|
187
|
+
: this.names.amd && this.namedDefine === true
|
188
|
+
? " define(" +
|
189
|
+
libraryName(this.names.amd) +
|
190
|
+
", [], " +
|
191
|
+
amdFactory +
|
192
|
+
");\n"
|
193
|
+
: " define([], " + amdFactory + ");\n") +
|
194
|
+
(this.names.root || this.names.commonjs
|
195
|
+
? (this.auxiliaryComment &&
|
196
|
+
typeof this.auxiliaryComment === "string"
|
197
|
+
? " //" + this.auxiliaryComment + "\n"
|
198
|
+
: this.auxiliaryComment.commonjs
|
199
|
+
? " //" + this.auxiliaryComment.commonjs + "\n"
|
200
|
+
: "") +
|
201
|
+
" else if(typeof exports === 'object')\n" +
|
202
|
+
" exports[" +
|
203
|
+
libraryName(this.names.commonjs || this.names.root) +
|
204
|
+
"] = factory(" +
|
205
|
+
externalsRequireArray("commonjs") +
|
206
|
+
");\n" +
|
207
|
+
(this.auxiliaryComment &&
|
208
|
+
typeof this.auxiliaryComment === "string"
|
209
|
+
? " //" + this.auxiliaryComment + "\n"
|
210
|
+
: this.auxiliaryComment.root
|
211
|
+
? " //" + this.auxiliaryComment.root + "\n"
|
212
|
+
: "") +
|
213
|
+
" else\n" +
|
214
|
+
" " +
|
215
|
+
replaceKeys(
|
216
|
+
accessorAccess("root", this.names.root || this.names.commonjs)
|
217
|
+
) +
|
218
|
+
" = factory(" +
|
219
|
+
externalsRootArray(externals) +
|
220
|
+
");\n"
|
221
|
+
: " else {\n" +
|
222
|
+
(externals.length > 0
|
223
|
+
? " var a = typeof exports === 'object' ? factory(" +
|
224
|
+
externalsRequireArray("commonjs") +
|
225
|
+
") : factory(" +
|
226
|
+
externalsRootArray(externals) +
|
227
|
+
");\n"
|
228
|
+
: " var a = factory();\n") +
|
229
|
+
" for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];\n" +
|
230
|
+
" }\n") +
|
231
|
+
`})(${
|
232
|
+
runtimeTemplate.outputOptions.globalObject
|
233
|
+
}, function(${externalsArguments(externals)}) {\nreturn `,
|
234
|
+
"webpack/universalModuleDefinition"
|
235
|
+
),
|
236
|
+
source,
|
237
|
+
";\n})"
|
238
|
+
);
|
239
|
+
};
|
240
|
+
|
241
|
+
for (const template of [mainTemplate, chunkTemplate]) {
|
242
|
+
template.hooks.renderWithEntry.tap(
|
243
|
+
"UmdMainTemplatePlugin",
|
244
|
+
onRenderWithEntry
|
245
|
+
);
|
246
|
+
}
|
247
|
+
|
248
|
+
mainTemplate.hooks.globalHashPaths.tap("UmdMainTemplatePlugin", paths => {
|
249
|
+
if (this.names.root) paths = paths.concat(this.names.root);
|
250
|
+
if (this.names.amd) paths = paths.concat(this.names.amd);
|
251
|
+
if (this.names.commonjs) paths = paths.concat(this.names.commonjs);
|
252
|
+
return paths;
|
253
|
+
});
|
254
|
+
|
255
|
+
mainTemplate.hooks.hash.tap("UmdMainTemplatePlugin", hash => {
|
256
|
+
hash.update("umd");
|
257
|
+
hash.update(`${this.names.root}`);
|
258
|
+
hash.update(`${this.names.amd}`);
|
259
|
+
hash.update(`${this.names.commonjs}`);
|
260
|
+
});
|
261
|
+
}
|
262
|
+
}
|
263
|
+
|
264
|
+
module.exports = UmdMainTemplatePlugin;
|