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,179 +1,175 @@
|
|
1
|
-
/*
|
2
|
-
MIT License http://www.opensource.org/licenses/mit-license.php
|
3
|
-
Author Tobias Koppers @sokra
|
4
|
-
*/
|
5
|
-
"use strict";
|
6
|
-
|
7
|
-
const ImportContextDependency = require("./ImportContextDependency");
|
8
|
-
const ImportWeakDependency = require("./ImportWeakDependency");
|
9
|
-
const ImportDependenciesBlock = require("./ImportDependenciesBlock");
|
10
|
-
const ImportEagerDependency = require("./ImportEagerDependency");
|
11
|
-
const ContextDependencyHelpers = require("./ContextDependencyHelpers");
|
12
|
-
const UnsupportedFeatureWarning = require("../UnsupportedFeatureWarning");
|
13
|
-
|
14
|
-
class ImportParserPlugin {
|
15
|
-
constructor(options) {
|
16
|
-
this.options = options;
|
17
|
-
}
|
18
|
-
|
19
|
-
apply(parser) {
|
20
|
-
parser.hooks.importCall.tap("ImportParserPlugin", expr => {
|
21
|
-
if (expr.arguments.length !== 1)
|
22
|
-
throw new Error(
|
23
|
-
"Incorrect number of arguments provided to 'import(module: string) -> Promise'."
|
24
|
-
);
|
25
|
-
|
26
|
-
const param = parser.evaluateExpression(expr.arguments[0]);
|
27
|
-
|
28
|
-
let chunkName = null;
|
29
|
-
let mode = "lazy";
|
30
|
-
let include = null;
|
31
|
-
let exclude = null;
|
32
|
-
|
33
|
-
const importOptions = parser.getCommentOptions(expr.range);
|
34
|
-
if (importOptions) {
|
35
|
-
if (typeof importOptions.webpackChunkName !== "undefined") {
|
36
|
-
if (typeof importOptions.webpackChunkName !== "string")
|
37
|
-
parser.state.module.warnings.push(
|
38
|
-
new UnsupportedFeatureWarning(
|
39
|
-
parser.state.module,
|
40
|
-
`\`webpackChunkName\` expected a string, but received: ${
|
41
|
-
importOptions.webpackChunkName
|
42
|
-
}.`
|
43
|
-
)
|
44
|
-
);
|
45
|
-
else chunkName = importOptions.webpackChunkName;
|
46
|
-
}
|
47
|
-
if (typeof importOptions.webpackMode !== "undefined") {
|
48
|
-
if (typeof importOptions.webpackMode !== "string")
|
49
|
-
parser.state.module.warnings.push(
|
50
|
-
new UnsupportedFeatureWarning(
|
51
|
-
parser.state.module,
|
52
|
-
`\`webpackMode\` expected a string, but received: ${
|
53
|
-
importOptions.webpackMode
|
54
|
-
}.`
|
55
|
-
)
|
56
|
-
);
|
57
|
-
else mode = importOptions.webpackMode;
|
58
|
-
}
|
59
|
-
if (typeof importOptions.webpackInclude !== "undefined") {
|
60
|
-
if (
|
61
|
-
!importOptions.webpackInclude ||
|
62
|
-
importOptions.webpackInclude.constructor.name !== "RegExp"
|
63
|
-
) {
|
64
|
-
parser.state.module.warnings.push(
|
65
|
-
new UnsupportedFeatureWarning(
|
66
|
-
parser.state.module,
|
67
|
-
`\`webpackInclude\` expected a regular expression, but received: ${
|
68
|
-
importOptions.webpackInclude
|
69
|
-
}.`
|
70
|
-
)
|
71
|
-
);
|
72
|
-
} else {
|
73
|
-
include = new RegExp(importOptions.webpackInclude);
|
74
|
-
}
|
75
|
-
}
|
76
|
-
if (typeof importOptions.webpackExclude !== "undefined") {
|
77
|
-
if (
|
78
|
-
!importOptions.webpackExclude ||
|
79
|
-
importOptions.webpackExclude.constructor.name !== "RegExp"
|
80
|
-
) {
|
81
|
-
parser.state.module.warnings.push(
|
82
|
-
new UnsupportedFeatureWarning(
|
83
|
-
parser.state.module,
|
84
|
-
`\`webpackExclude\` expected a regular expression, but received: ${
|
85
|
-
importOptions.webpackExclude
|
86
|
-
}.`
|
87
|
-
)
|
88
|
-
);
|
89
|
-
} else {
|
90
|
-
exclude = new RegExp(importOptions.webpackExclude);
|
91
|
-
}
|
92
|
-
}
|
93
|
-
}
|
94
|
-
|
95
|
-
if (param.isString()) {
|
96
|
-
if (mode !== "lazy" && mode !== "eager" && mode !== "weak") {
|
97
|
-
parser.state.module.warnings.push(
|
98
|
-
new UnsupportedFeatureWarning(
|
99
|
-
parser.state.module,
|
100
|
-
`\`webpackMode\` expected 'lazy', 'eager' or 'weak', but received: ${
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
parser.state.module
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
mode !== "
|
136
|
-
mode !== "
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
mode = "
|
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
|
-
module.exports = ImportParserPlugin;
|
1
|
+
/*
|
2
|
+
MIT License http://www.opensource.org/licenses/mit-license.php
|
3
|
+
Author Tobias Koppers @sokra
|
4
|
+
*/
|
5
|
+
"use strict";
|
6
|
+
|
7
|
+
const ImportContextDependency = require("./ImportContextDependency");
|
8
|
+
const ImportWeakDependency = require("./ImportWeakDependency");
|
9
|
+
const ImportDependenciesBlock = require("./ImportDependenciesBlock");
|
10
|
+
const ImportEagerDependency = require("./ImportEagerDependency");
|
11
|
+
const ContextDependencyHelpers = require("./ContextDependencyHelpers");
|
12
|
+
const UnsupportedFeatureWarning = require("../UnsupportedFeatureWarning");
|
13
|
+
|
14
|
+
class ImportParserPlugin {
|
15
|
+
constructor(options) {
|
16
|
+
this.options = options;
|
17
|
+
}
|
18
|
+
|
19
|
+
apply(parser) {
|
20
|
+
parser.hooks.importCall.tap("ImportParserPlugin", expr => {
|
21
|
+
if (expr.arguments.length !== 1)
|
22
|
+
throw new Error(
|
23
|
+
"Incorrect number of arguments provided to 'import(module: string) -> Promise'."
|
24
|
+
);
|
25
|
+
|
26
|
+
const param = parser.evaluateExpression(expr.arguments[0]);
|
27
|
+
|
28
|
+
let chunkName = null;
|
29
|
+
let mode = "lazy";
|
30
|
+
let include = null;
|
31
|
+
let exclude = null;
|
32
|
+
|
33
|
+
const importOptions = parser.getCommentOptions(expr.range);
|
34
|
+
if (importOptions) {
|
35
|
+
if (typeof importOptions.webpackChunkName !== "undefined") {
|
36
|
+
if (typeof importOptions.webpackChunkName !== "string")
|
37
|
+
parser.state.module.warnings.push(
|
38
|
+
new UnsupportedFeatureWarning(
|
39
|
+
parser.state.module,
|
40
|
+
`\`webpackChunkName\` expected a string, but received: ${
|
41
|
+
importOptions.webpackChunkName
|
42
|
+
}.`
|
43
|
+
)
|
44
|
+
);
|
45
|
+
else chunkName = importOptions.webpackChunkName;
|
46
|
+
}
|
47
|
+
if (typeof importOptions.webpackMode !== "undefined") {
|
48
|
+
if (typeof importOptions.webpackMode !== "string")
|
49
|
+
parser.state.module.warnings.push(
|
50
|
+
new UnsupportedFeatureWarning(
|
51
|
+
parser.state.module,
|
52
|
+
`\`webpackMode\` expected a string, but received: ${
|
53
|
+
importOptions.webpackMode
|
54
|
+
}.`
|
55
|
+
)
|
56
|
+
);
|
57
|
+
else mode = importOptions.webpackMode;
|
58
|
+
}
|
59
|
+
if (typeof importOptions.webpackInclude !== "undefined") {
|
60
|
+
if (
|
61
|
+
!importOptions.webpackInclude ||
|
62
|
+
importOptions.webpackInclude.constructor.name !== "RegExp"
|
63
|
+
) {
|
64
|
+
parser.state.module.warnings.push(
|
65
|
+
new UnsupportedFeatureWarning(
|
66
|
+
parser.state.module,
|
67
|
+
`\`webpackInclude\` expected a regular expression, but received: ${
|
68
|
+
importOptions.webpackInclude
|
69
|
+
}.`
|
70
|
+
)
|
71
|
+
);
|
72
|
+
} else {
|
73
|
+
include = new RegExp(importOptions.webpackInclude);
|
74
|
+
}
|
75
|
+
}
|
76
|
+
if (typeof importOptions.webpackExclude !== "undefined") {
|
77
|
+
if (
|
78
|
+
!importOptions.webpackExclude ||
|
79
|
+
importOptions.webpackExclude.constructor.name !== "RegExp"
|
80
|
+
) {
|
81
|
+
parser.state.module.warnings.push(
|
82
|
+
new UnsupportedFeatureWarning(
|
83
|
+
parser.state.module,
|
84
|
+
`\`webpackExclude\` expected a regular expression, but received: ${
|
85
|
+
importOptions.webpackExclude
|
86
|
+
}.`
|
87
|
+
)
|
88
|
+
);
|
89
|
+
} else {
|
90
|
+
exclude = new RegExp(importOptions.webpackExclude);
|
91
|
+
}
|
92
|
+
}
|
93
|
+
}
|
94
|
+
|
95
|
+
if (param.isString()) {
|
96
|
+
if (mode !== "lazy" && mode !== "eager" && mode !== "weak") {
|
97
|
+
parser.state.module.warnings.push(
|
98
|
+
new UnsupportedFeatureWarning(
|
99
|
+
parser.state.module,
|
100
|
+
`\`webpackMode\` expected 'lazy', 'eager' or 'weak', but received: ${mode}.`
|
101
|
+
)
|
102
|
+
);
|
103
|
+
}
|
104
|
+
|
105
|
+
if (mode === "eager") {
|
106
|
+
const dep = new ImportEagerDependency(
|
107
|
+
param.string,
|
108
|
+
parser.state.module,
|
109
|
+
expr.range
|
110
|
+
);
|
111
|
+
parser.state.current.addDependency(dep);
|
112
|
+
} else if (mode === "weak") {
|
113
|
+
const dep = new ImportWeakDependency(
|
114
|
+
param.string,
|
115
|
+
parser.state.module,
|
116
|
+
expr.range
|
117
|
+
);
|
118
|
+
parser.state.current.addDependency(dep);
|
119
|
+
} else {
|
120
|
+
const depBlock = new ImportDependenciesBlock(
|
121
|
+
param.string,
|
122
|
+
expr.range,
|
123
|
+
chunkName,
|
124
|
+
parser.state.module,
|
125
|
+
expr.loc,
|
126
|
+
parser.state.module
|
127
|
+
);
|
128
|
+
parser.state.current.addBlock(depBlock);
|
129
|
+
}
|
130
|
+
return true;
|
131
|
+
} else {
|
132
|
+
if (
|
133
|
+
mode !== "lazy" &&
|
134
|
+
mode !== "lazy-once" &&
|
135
|
+
mode !== "eager" &&
|
136
|
+
mode !== "weak"
|
137
|
+
) {
|
138
|
+
parser.state.module.warnings.push(
|
139
|
+
new UnsupportedFeatureWarning(
|
140
|
+
parser.state.module,
|
141
|
+
`\`webpackMode\` expected 'lazy', 'lazy-once', 'eager' or 'weak', but received: ${mode}.`
|
142
|
+
)
|
143
|
+
);
|
144
|
+
mode = "lazy";
|
145
|
+
}
|
146
|
+
|
147
|
+
if (mode === "weak") {
|
148
|
+
mode = "async-weak";
|
149
|
+
}
|
150
|
+
const dep = ContextDependencyHelpers.create(
|
151
|
+
ImportContextDependency,
|
152
|
+
expr.range,
|
153
|
+
param,
|
154
|
+
expr,
|
155
|
+
this.options,
|
156
|
+
{
|
157
|
+
chunkName,
|
158
|
+
include,
|
159
|
+
exclude,
|
160
|
+
mode,
|
161
|
+
namespaceObject: parser.state.module.buildMeta.strictHarmonyModule
|
162
|
+
? "strict"
|
163
|
+
: true
|
164
|
+
}
|
165
|
+
);
|
166
|
+
if (!dep) return;
|
167
|
+
dep.loc = expr.loc;
|
168
|
+
dep.optional = !!parser.scope.inTry;
|
169
|
+
parser.state.current.addDependency(dep);
|
170
|
+
return true;
|
171
|
+
}
|
172
|
+
});
|
173
|
+
}
|
174
|
+
}
|
175
|
+
module.exports = ImportParserPlugin;
|
@@ -1,34 +1,34 @@
|
|
1
|
-
/*
|
2
|
-
MIT License http://www.opensource.org/licenses/mit-license.php
|
3
|
-
Author Tobias Koppers @sokra
|
4
|
-
*/
|
5
|
-
"use strict";
|
6
|
-
const ModuleDependency = require("./ModuleDependency");
|
7
|
-
|
8
|
-
class ImportWeakDependency extends ModuleDependency {
|
9
|
-
constructor(request, originModule, range) {
|
10
|
-
super(request);
|
11
|
-
this.originModule = originModule;
|
12
|
-
this.range = range;
|
13
|
-
this.weak = true;
|
14
|
-
}
|
15
|
-
|
16
|
-
get type() {
|
17
|
-
return "import() weak";
|
18
|
-
}
|
19
|
-
}
|
20
|
-
|
21
|
-
ImportWeakDependency.Template = class ImportDependencyTemplate {
|
22
|
-
apply(dep, source, runtime) {
|
23
|
-
const content = runtime.moduleNamespacePromise({
|
24
|
-
module: dep.module,
|
25
|
-
request: dep.request,
|
26
|
-
strict: dep.originModule.buildMeta.strictHarmonyModule,
|
27
|
-
message: "import() weak",
|
28
|
-
weak: true
|
29
|
-
});
|
30
|
-
source.replace(dep.range[0], dep.range[1] - 1, content);
|
31
|
-
}
|
32
|
-
};
|
33
|
-
|
34
|
-
module.exports = ImportWeakDependency;
|
1
|
+
/*
|
2
|
+
MIT License http://www.opensource.org/licenses/mit-license.php
|
3
|
+
Author Tobias Koppers @sokra
|
4
|
+
*/
|
5
|
+
"use strict";
|
6
|
+
const ModuleDependency = require("./ModuleDependency");
|
7
|
+
|
8
|
+
class ImportWeakDependency extends ModuleDependency {
|
9
|
+
constructor(request, originModule, range) {
|
10
|
+
super(request);
|
11
|
+
this.originModule = originModule;
|
12
|
+
this.range = range;
|
13
|
+
this.weak = true;
|
14
|
+
}
|
15
|
+
|
16
|
+
get type() {
|
17
|
+
return "import() weak";
|
18
|
+
}
|
19
|
+
}
|
20
|
+
|
21
|
+
ImportWeakDependency.Template = class ImportDependencyTemplate {
|
22
|
+
apply(dep, source, runtime) {
|
23
|
+
const content = runtime.moduleNamespacePromise({
|
24
|
+
module: dep.module,
|
25
|
+
request: dep.request,
|
26
|
+
strict: dep.originModule.buildMeta.strictHarmonyModule,
|
27
|
+
message: "import() weak",
|
28
|
+
weak: true
|
29
|
+
});
|
30
|
+
source.replace(dep.range[0], dep.range[1] - 1, content);
|
31
|
+
}
|
32
|
+
};
|
33
|
+
|
34
|
+
module.exports = ImportWeakDependency;
|
@@ -1,25 +1,25 @@
|
|
1
|
-
/*
|
2
|
-
MIT License http://www.opensource.org/licenses/mit-license.php
|
3
|
-
Author Tobias Koppers @sokra
|
4
|
-
*/
|
5
|
-
"use strict";
|
6
|
-
const NullDependency = require("./NullDependency");
|
7
|
-
|
8
|
-
class JsonExportsDependency extends NullDependency {
|
9
|
-
constructor(exports) {
|
10
|
-
super();
|
11
|
-
this.exports = exports;
|
12
|
-
}
|
13
|
-
|
14
|
-
get type() {
|
15
|
-
return "json exports";
|
16
|
-
}
|
17
|
-
|
18
|
-
getExports() {
|
19
|
-
return {
|
20
|
-
exports: this.exports
|
21
|
-
};
|
22
|
-
}
|
23
|
-
}
|
24
|
-
|
25
|
-
module.exports = JsonExportsDependency;
|
1
|
+
/*
|
2
|
+
MIT License http://www.opensource.org/licenses/mit-license.php
|
3
|
+
Author Tobias Koppers @sokra
|
4
|
+
*/
|
5
|
+
"use strict";
|
6
|
+
const NullDependency = require("./NullDependency");
|
7
|
+
|
8
|
+
class JsonExportsDependency extends NullDependency {
|
9
|
+
constructor(exports) {
|
10
|
+
super();
|
11
|
+
this.exports = exports;
|
12
|
+
}
|
13
|
+
|
14
|
+
get type() {
|
15
|
+
return "json exports";
|
16
|
+
}
|
17
|
+
|
18
|
+
getExports() {
|
19
|
+
return {
|
20
|
+
exports: this.exports
|
21
|
+
};
|
22
|
+
}
|
23
|
+
}
|
24
|
+
|
25
|
+
module.exports = JsonExportsDependency;
|
@@ -1,20 +1,20 @@
|
|
1
|
-
/*
|
2
|
-
MIT License http://www.opensource.org/licenses/mit-license.php
|
3
|
-
Author Tobias Koppers @sokra
|
4
|
-
*/
|
5
|
-
"use strict";
|
6
|
-
const Dependency = require("../Dependency");
|
7
|
-
|
8
|
-
class ModuleDependency extends Dependency {
|
9
|
-
constructor(request) {
|
10
|
-
super();
|
11
|
-
this.request = request;
|
12
|
-
this.userRequest = request;
|
13
|
-
}
|
14
|
-
|
15
|
-
getResourceIdentifier() {
|
16
|
-
return `module${this.request}`;
|
17
|
-
}
|
18
|
-
}
|
19
|
-
|
20
|
-
module.exports = ModuleDependency;
|
1
|
+
/*
|
2
|
+
MIT License http://www.opensource.org/licenses/mit-license.php
|
3
|
+
Author Tobias Koppers @sokra
|
4
|
+
*/
|
5
|
+
"use strict";
|
6
|
+
const Dependency = require("../Dependency");
|
7
|
+
|
8
|
+
class ModuleDependency extends Dependency {
|
9
|
+
constructor(request) {
|
10
|
+
super();
|
11
|
+
this.request = request;
|
12
|
+
this.userRequest = request;
|
13
|
+
}
|
14
|
+
|
15
|
+
getResourceIdentifier() {
|
16
|
+
return `module${this.request}`;
|
17
|
+
}
|
18
|
+
}
|
19
|
+
|
20
|
+
module.exports = ModuleDependency;
|
@@ -1,20 +1,20 @@
|
|
1
|
-
/*
|
2
|
-
MIT License http://www.opensource.org/licenses/mit-license.php
|
3
|
-
Author Tobias Koppers @sokra
|
4
|
-
*/
|
5
|
-
"use strict";
|
6
|
-
const Dependency = require("../Dependency");
|
7
|
-
|
8
|
-
class NullDependency extends Dependency {
|
9
|
-
get type() {
|
10
|
-
return "null";
|
11
|
-
}
|
12
|
-
|
13
|
-
updateHash() {}
|
14
|
-
}
|
15
|
-
|
16
|
-
NullDependency.Template = class NullDependencyTemplate {
|
17
|
-
apply() {}
|
18
|
-
};
|
19
|
-
|
20
|
-
module.exports = NullDependency;
|
1
|
+
/*
|
2
|
+
MIT License http://www.opensource.org/licenses/mit-license.php
|
3
|
+
Author Tobias Koppers @sokra
|
4
|
+
*/
|
5
|
+
"use strict";
|
6
|
+
const Dependency = require("../Dependency");
|
7
|
+
|
8
|
+
class NullDependency extends Dependency {
|
9
|
+
get type() {
|
10
|
+
return "null";
|
11
|
+
}
|
12
|
+
|
13
|
+
updateHash() {}
|
14
|
+
}
|
15
|
+
|
16
|
+
NullDependency.Template = class NullDependencyTemplate {
|
17
|
+
apply() {}
|
18
|
+
};
|
19
|
+
|
20
|
+
module.exports = NullDependency;
|
@@ -1,22 +1,22 @@
|
|
1
|
-
/*
|
2
|
-
MIT License http://www.opensource.org/licenses/mit-license.php
|
3
|
-
Author Tobias Koppers @sokra
|
4
|
-
*/
|
5
|
-
"use strict";
|
6
|
-
const ContextDependency = require("./ContextDependency");
|
7
|
-
const ModuleDependencyTemplateAsRequireId = require("./ModuleDependencyTemplateAsRequireId");
|
8
|
-
|
9
|
-
class RequireContextDependency extends ContextDependency {
|
10
|
-
constructor(options, range) {
|
11
|
-
super(options);
|
12
|
-
this.range = range;
|
13
|
-
}
|
14
|
-
|
15
|
-
get type() {
|
16
|
-
return "require.context";
|
17
|
-
}
|
18
|
-
}
|
19
|
-
|
20
|
-
RequireContextDependency.Template = ModuleDependencyTemplateAsRequireId;
|
21
|
-
|
22
|
-
module.exports = RequireContextDependency;
|
1
|
+
/*
|
2
|
+
MIT License http://www.opensource.org/licenses/mit-license.php
|
3
|
+
Author Tobias Koppers @sokra
|
4
|
+
*/
|
5
|
+
"use strict";
|
6
|
+
const ContextDependency = require("./ContextDependency");
|
7
|
+
const ModuleDependencyTemplateAsRequireId = require("./ModuleDependencyTemplateAsRequireId");
|
8
|
+
|
9
|
+
class RequireContextDependency extends ContextDependency {
|
10
|
+
constructor(options, range) {
|
11
|
+
super(options);
|
12
|
+
this.range = range;
|
13
|
+
}
|
14
|
+
|
15
|
+
get type() {
|
16
|
+
return "require.context";
|
17
|
+
}
|
18
|
+
}
|
19
|
+
|
20
|
+
RequireContextDependency.Template = ModuleDependencyTemplateAsRequireId;
|
21
|
+
|
22
|
+
module.exports = RequireContextDependency;
|