webpack 5.100.2 → 5.101.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 +12 -10
- package/bin/webpack.js +7 -7
- package/lib/APIPlugin.js +12 -14
- package/lib/AutomaticPrefetchPlugin.js +2 -2
- package/lib/BannerPlugin.js +4 -4
- package/lib/Cache.js +1 -1
- package/lib/CacheFacade.js +7 -7
- package/lib/CaseSensitiveModulesWarning.js +2 -2
- package/lib/Chunk.js +3 -3
- package/lib/ChunkGraph.js +21 -18
- package/lib/ChunkGroup.js +4 -4
- package/lib/CleanPlugin.js +19 -53
- package/lib/CodeGenerationResults.js +3 -3
- package/lib/CompatibilityPlugin.js +6 -6
- package/lib/Compilation.js +126 -113
- package/lib/Compiler.js +37 -37
- package/lib/ConcatenationScope.js +39 -1
- package/lib/ConstPlugin.js +11 -11
- package/lib/ContextExclusionPlugin.js +3 -3
- package/lib/ContextModule.js +12 -11
- package/lib/ContextModuleFactory.js +11 -11
- package/lib/ContextReplacementPlugin.js +5 -5
- package/lib/DefinePlugin.js +24 -22
- package/lib/DelegatedModuleFactoryPlugin.js +1 -1
- package/lib/DllEntryPlugin.js +1 -1
- package/lib/DllReferencePlugin.js +1 -1
- package/lib/DynamicEntryPlugin.js +3 -3
- package/lib/EntryPlugin.js +1 -1
- package/lib/EnvironmentPlugin.js +1 -1
- package/lib/ErrorHelpers.js +2 -2
- package/lib/EvalDevToolModulePlugin.js +2 -2
- package/lib/EvalSourceMapDevToolPlugin.js +5 -5
- package/lib/ExportsInfo.js +9 -9
- package/lib/ExportsInfoApiPlugin.js +2 -2
- package/lib/ExternalModule.js +163 -48
- package/lib/ExternalModuleFactoryPlugin.js +2 -2
- package/lib/ExternalsPlugin.js +45 -0
- package/lib/FileSystemInfo.js +64 -61
- package/lib/FlagAllModulesAsUsedPlugin.js +2 -2
- package/lib/FlagDependencyExportsPlugin.js +7 -7
- package/lib/FlagDependencyUsagePlugin.js +4 -4
- package/lib/FlagEntryExportAsUsedPlugin.js +1 -1
- package/lib/HotModuleReplacementPlugin.js +27 -27
- package/lib/IgnorePlugin.js +3 -3
- package/lib/IgnoreWarningsPlugin.js +4 -4
- package/lib/InitFragment.js +6 -0
- package/lib/InvalidDependenciesModuleWarning.js +1 -1
- package/lib/JavascriptMetaInfoPlugin.js +1 -1
- package/lib/LibManifestPlugin.js +2 -2
- package/lib/LoaderOptionsPlugin.js +1 -1
- package/lib/LoaderTargetPlugin.js +2 -2
- package/lib/MainTemplate.js +1 -1
- package/lib/Module.js +1 -1
- package/lib/ModuleFilenameHelpers.js +3 -3
- package/lib/ModuleGraph.js +9 -5
- package/lib/ModuleInfoHeaderPlugin.js +3 -3
- package/lib/ModuleParseError.js +5 -3
- package/lib/MultiCompiler.js +29 -24
- package/lib/MultiStats.js +18 -13
- package/lib/MultiWatching.js +1 -1
- package/lib/NoEmitOnErrorsPlugin.js +2 -2
- package/lib/NodeStuffPlugin.js +27 -15
- package/lib/NormalModule.js +23 -23
- package/lib/NormalModuleFactory.js +23 -21
- package/lib/NormalModuleReplacementPlugin.js +3 -3
- package/lib/PrefetchPlugin.js +1 -1
- package/lib/ProgressPlugin.js +11 -11
- package/lib/ProvidePlugin.js +2 -2
- package/lib/RecordIdsPlugin.js +3 -3
- package/lib/ResolverFactory.js +3 -3
- package/lib/RuntimeGlobals.js +20 -0
- package/lib/RuntimePlugin.js +16 -16
- package/lib/RuntimeTemplate.js +35 -26
- package/lib/SizeFormatHelpers.js +1 -1
- package/lib/SourceMapDevToolModuleOptionsPlugin.js +4 -4
- package/lib/SourceMapDevToolPlugin.js +9 -9
- package/lib/Stats.js +2 -2
- package/lib/Template.js +1 -1
- package/lib/TemplatedPathPlugin.js +2 -2
- package/lib/UseStrictPlugin.js +1 -1
- package/lib/WarnCaseSensitiveModulesPlugin.js +1 -1
- package/lib/WarnDeprecatedOptionPlugin.js +1 -1
- package/lib/WarnNoModeSetPlugin.js +1 -1
- package/lib/WatchIgnorePlugin.js +2 -2
- package/lib/Watching.js +12 -12
- package/lib/WebpackIsIncludedPlugin.js +2 -2
- package/lib/WebpackOptionsApply.js +3 -3
- package/lib/asset/AssetGenerator.js +1 -1
- package/lib/asset/AssetModulesPlugin.js +6 -6
- package/lib/async-modules/AsyncModuleHelpers.js +1 -1
- package/lib/async-modules/AwaitDependenciesInitFragment.js +36 -24
- package/lib/async-modules/InferAsyncModulesPlugin.js +3 -3
- package/lib/buildChunkGraph.js +5 -5
- package/lib/cache/AddBuildDependenciesPlugin.js +1 -1
- package/lib/cache/IdleFileCachePlugin.js +5 -5
- package/lib/cache/PackFileCacheStrategy.js +20 -20
- package/lib/cache/ResolverCachePlugin.js +4 -4
- package/lib/cli.js +196 -14
- package/lib/config/browserslistTargetHandler.js +6 -6
- package/lib/config/defaults.js +23 -14
- package/lib/config/normalization.js +41 -38
- package/lib/config/target.js +4 -4
- package/lib/container/ContainerEntryModule.js +3 -3
- package/lib/container/ContainerPlugin.js +3 -3
- package/lib/container/ContainerReferencePlugin.js +3 -3
- package/lib/container/FallbackModule.js +1 -1
- package/lib/container/HoistContainerReferencesPlugin.js +7 -7
- package/lib/container/options.js +4 -4
- package/lib/css/CssGenerator.js +5 -3
- package/lib/css/CssLoadingRuntimeModule.js +1 -1
- package/lib/css/CssModulesPlugin.js +25 -22
- package/lib/css/CssParser.js +5 -5
- package/lib/css/walkCssTokens.js +9 -9
- package/lib/debug/ProfilingPlugin.js +5 -5
- package/lib/dependencies/AMDDefineDependencyParserPlugin.js +4 -4
- package/lib/dependencies/AMDPlugin.js +3 -3
- package/lib/dependencies/AMDRequireArrayDependency.js +1 -1
- package/lib/dependencies/AMDRequireDependenciesBlockParserPlugin.js +3 -3
- package/lib/dependencies/CommonJsExportRequireDependency.js +2 -2
- package/lib/dependencies/CommonJsExportsParserPlugin.js +12 -10
- package/lib/dependencies/CommonJsImportsParserPlugin.js +21 -19
- package/lib/dependencies/CommonJsPlugin.js +2 -2
- package/lib/dependencies/ContextDependency.js +1 -1
- package/lib/dependencies/ContextDependencyHelpers.js +3 -3
- package/lib/dependencies/CssIcssExportDependency.js +2 -2
- package/lib/dependencies/CssLocalIdentifierDependency.js +2 -2
- package/lib/dependencies/CssUrlDependency.js +4 -4
- package/lib/dependencies/DynamicExports.js +5 -5
- package/lib/dependencies/HarmonyAcceptDependency.js +39 -5
- package/lib/dependencies/HarmonyDetectionParserPlugin.js +2 -2
- package/lib/dependencies/HarmonyExportDependencyParserPlugin.js +17 -13
- package/lib/dependencies/HarmonyExportImportedSpecifierDependency.js +7 -8
- package/lib/dependencies/HarmonyExportInitFragment.js +1 -1
- package/lib/dependencies/HarmonyExports.js +1 -1
- package/lib/dependencies/HarmonyImportDependency.js +28 -9
- package/lib/dependencies/HarmonyImportDependencyParserPlugin.js +56 -48
- package/lib/dependencies/HarmonyImportSideEffectDependency.js +4 -5
- package/lib/dependencies/HarmonyImportSpecifierDependency.js +3 -4
- package/lib/dependencies/HarmonyModulesPlugin.js +2 -8
- package/lib/dependencies/HarmonyTopLevelThisParserPlugin.js +1 -1
- package/lib/dependencies/ImportMetaContextDependencyParserPlugin.js +4 -4
- package/lib/dependencies/ImportMetaPlugin.js +7 -7
- package/lib/dependencies/ImportParserPlugin.js +4 -4
- package/lib/dependencies/JsonExportsDependency.js +1 -1
- package/lib/dependencies/LoaderPlugin.js +4 -4
- package/lib/dependencies/ProvidedDependency.js +2 -2
- package/lib/dependencies/PureExpressionDependency.js +1 -1
- package/lib/dependencies/RequireContextDependencyParserPlugin.js +1 -1
- package/lib/dependencies/RequireEnsureDependenciesBlockParserPlugin.js +1 -1
- package/lib/dependencies/RequireIncludeDependencyParserPlugin.js +3 -3
- package/lib/dependencies/SystemPlugin.js +3 -3
- package/lib/dependencies/WorkerPlugin.js +5 -5
- package/lib/dependencies/getFunctionExpression.js +1 -1
- package/lib/esm/ModuleChunkFormatPlugin.js +5 -5
- package/lib/esm/ModuleChunkLoadingPlugin.js +2 -2
- package/lib/esm/ModuleChunkLoadingRuntimeModule.js +15 -11
- package/lib/formatLocation.js +2 -2
- package/lib/hmr/HotModuleReplacement.runtime.js +39 -27
- package/lib/hmr/JavascriptHotModuleReplacement.runtime.js +43 -32
- package/lib/hmr/JavascriptHotModuleReplacementHelper.js +1 -1
- package/lib/hmr/LazyCompilationPlugin.js +6 -6
- package/lib/hmr/lazyCompilationBackend.js +6 -6
- package/lib/ids/ChunkModuleIdRangePlugin.js +4 -4
- package/lib/ids/DeterministicChunkIdsPlugin.js +5 -4
- package/lib/ids/DeterministicModuleIdsPlugin.js +2 -2
- package/lib/ids/HashedModuleIdsPlugin.js +1 -1
- package/lib/ids/IdHelpers.js +9 -9
- package/lib/ids/NamedChunkIdsPlugin.js +5 -5
- package/lib/ids/NamedModuleIdsPlugin.js +2 -2
- package/lib/ids/NaturalChunkIdsPlugin.js +2 -2
- package/lib/ids/NaturalModuleIdsPlugin.js +1 -1
- package/lib/ids/OccurrenceChunkIdsPlugin.js +2 -2
- package/lib/ids/OccurrenceModuleIdsPlugin.js +4 -4
- package/lib/ids/SyncModuleIdsPlugin.js +4 -4
- package/lib/index.js +10 -6
- package/lib/javascript/ArrayPushCallbackChunkFormatPlugin.js +1 -1
- package/lib/javascript/BasicEvaluatedExpression.js +3 -3
- package/lib/javascript/CommonJsChunkFormatPlugin.js +1 -1
- package/lib/javascript/EnableChunkLoadingPlugin.js +1 -1
- package/lib/javascript/JavascriptGenerator.js +1 -1
- package/lib/javascript/JavascriptModulesPlugin.js +16 -16
- package/lib/javascript/JavascriptParser.js +80 -78
- package/lib/javascript/JavascriptParserHelpers.js +3 -3
- package/lib/javascript/StartupHelpers.js +2 -2
- package/lib/json/JsonGenerator.js +2 -2
- package/lib/json/JsonModulesPlugin.js +2 -2
- package/lib/library/AbstractLibraryPlugin.js +3 -3
- package/lib/library/AmdLibraryPlugin.js +3 -3
- package/lib/library/AssignLibraryPlugin.js +2 -2
- package/lib/library/EnableLibraryPlugin.js +2 -2
- package/lib/library/ModuleLibraryPlugin.js +7 -2
- package/lib/library/SystemLibraryPlugin.js +6 -4
- package/lib/library/UmdLibraryPlugin.js +14 -14
- package/lib/logging/createConsoleLogger.js +4 -4
- package/lib/logging/runtime.js +3 -3
- package/lib/logging/truncateArgs.js +4 -4
- package/lib/node/CommonJsChunkLoadingPlugin.js +2 -2
- package/lib/node/NodeEnvironmentPlugin.js +1 -1
- package/lib/node/ReadFileChunkLoadingRuntimeModule.js +16 -14
- package/lib/node/ReadFileCompileAsyncWasmPlugin.js +7 -7
- package/lib/node/ReadFileCompileWasmPlugin.js +7 -7
- package/lib/node/RequireChunkLoadingRuntimeModule.js +6 -4
- package/lib/node/nodeConsole.js +2 -2
- package/lib/optimize/AggressiveMergingPlugin.js +2 -2
- package/lib/optimize/AggressiveSplittingPlugin.js +10 -10
- package/lib/optimize/ConcatenatedModule.js +161 -52
- package/lib/optimize/EnsureChunkConditionsPlugin.js +2 -2
- package/lib/optimize/FlagIncludedChunksPlugin.js +2 -2
- package/lib/optimize/InnerGraph.js +5 -5
- package/lib/optimize/InnerGraphPlugin.js +14 -12
- package/lib/optimize/LimitChunkCountPlugin.js +5 -5
- package/lib/optimize/MangleExportsPlugin.js +5 -5
- package/lib/optimize/MergeDuplicateChunksPlugin.js +2 -2
- package/lib/optimize/MinChunkSizePlugin.js +3 -3
- package/lib/optimize/ModuleConcatenationPlugin.js +45 -38
- package/lib/optimize/RealContentHashPlugin.js +23 -23
- package/lib/optimize/RemoveEmptyChunksPlugin.js +2 -2
- package/lib/optimize/RemoveParentModulesPlugin.js +3 -3
- package/lib/optimize/RuntimeChunkPlugin.js +2 -2
- package/lib/optimize/SideEffectsFlagPlugin.js +5 -5
- package/lib/optimize/SplitChunksPlugin.js +20 -20
- package/lib/performance/AssetsOverSizeLimitWarning.js +1 -1
- package/lib/performance/EntrypointsOverSizeLimitWarning.js +2 -2
- package/lib/performance/SizeLimitsPlugin.js +4 -4
- package/lib/prefetch/ChunkPrefetchPreloadPlugin.js +1 -1
- package/lib/prefetch/ChunkPrefetchStartupRuntimeModule.js +3 -3
- package/lib/rules/BasicMatcherRulePlugin.js +1 -1
- package/lib/rules/RuleSetCompiler.js +10 -10
- package/lib/rules/UseEffectRulePlugin.js +2 -2
- package/lib/runtime/GetChunkFilenameRuntimeModule.js +15 -15
- package/lib/runtime/GetMainFilenameRuntimeModule.js +1 -1
- package/lib/runtime/GetTrustedTypesPolicyRuntimeModule.js +1 -1
- package/lib/runtime/MakeDeferredNamespaceObjectRuntime.js +1 -1
- package/lib/runtime/StartupChunkDependenciesPlugin.js +2 -2
- package/lib/runtime/StartupChunkDependenciesRuntimeModule.js +3 -3
- package/lib/schemes/DataUriPlugin.js +3 -3
- package/lib/schemes/FileUriPlugin.js +1 -1
- package/lib/schemes/HttpUriPlugin.js +40 -36
- package/lib/schemes/VirtualUrlPlugin.js +1 -1
- package/lib/serialization/BinaryMiddleware.js +11 -11
- package/lib/serialization/FileMiddleware.js +17 -17
- package/lib/serialization/ObjectMiddleware.js +8 -8
- package/lib/serialization/Serializer.js +2 -2
- package/lib/serialization/SerializerMiddleware.js +2 -2
- package/lib/sharing/ConsumeSharedPlugin.js +4 -4
- package/lib/sharing/ProvideSharedPlugin.js +4 -4
- package/lib/sharing/SharePlugin.js +1 -1
- package/lib/sharing/resolveMatchedConfigs.js +1 -1
- package/lib/stats/DefaultStatsFactoryPlugin.js +85 -80
- package/lib/stats/DefaultStatsPresetPlugin.js +15 -15
- package/lib/stats/DefaultStatsPrinterPlugin.js +87 -87
- package/lib/stats/StatsFactory.js +7 -7
- package/lib/stats/StatsPrinter.js +9 -9
- package/lib/url/URLParserPlugin.js +5 -5
- package/lib/util/AsyncQueue.js +4 -4
- package/lib/util/IterableHelpers.js +2 -2
- package/lib/util/LazyBucketSortedSet.js +3 -3
- package/lib/util/SetHelpers.js +2 -2
- package/lib/util/StackedCacheMap.js +1 -1
- package/lib/util/StackedMap.js +1 -1
- package/lib/util/TupleSet.js +1 -1
- package/lib/util/WeakTupleMap.js +1 -1
- package/lib/util/cleverMerge.js +8 -8
- package/lib/util/comparators.js +10 -10
- package/lib/util/compileBooleanMatcher.js +20 -20
- package/lib/util/concatenate.js +3 -3
- package/lib/util/conventions.js +4 -4
- package/lib/util/create-schema-validation.js +1 -1
- package/lib/util/createHash.js +1 -1
- package/lib/util/deprecation.js +4 -4
- package/lib/util/deterministicGrouping.js +7 -7
- package/lib/util/findGraphRoots.js +1 -1
- package/lib/util/fs.js +3 -3
- package/lib/util/identifier.js +14 -14
- package/lib/util/magicComment.js +5 -1
- package/lib/util/memoize.js +1 -1
- package/lib/util/processAsyncTree.js +2 -2
- package/lib/util/propertyName.js +1 -1
- package/lib/util/removeBOM.js +1 -1
- package/lib/util/runtime.js +6 -6
- package/lib/util/semver.js +16 -16
- package/lib/util/serialization.js +5 -5
- package/lib/util/smartGrouping.js +1 -1
- package/lib/validateSchema.js +2 -2
- package/lib/wasm/EnableWasmLoadingPlugin.js +1 -1
- package/lib/wasm-async/AsyncWasmLoadingRuntimeModule.js +1 -1
- package/lib/wasm-async/AsyncWebAssemblyJavascriptGenerator.js +1 -1
- package/lib/wasm-async/UniversalCompileAsyncWasmPlugin.js +4 -4
- package/lib/wasm-sync/WasmChunkLoadingRuntimeModule.js +13 -9
- package/lib/wasm-sync/WasmFinalizeExportsPlugin.js +2 -2
- package/lib/wasm-sync/WebAssemblyGenerator.js +14 -14
- package/lib/wasm-sync/WebAssemblyInInitialChunkError.js +4 -2
- package/lib/wasm-sync/WebAssemblyParser.js +2 -2
- package/lib/web/FetchCompileAsyncWasmPlugin.js +4 -4
- package/lib/web/FetchCompileWasmPlugin.js +4 -4
- package/lib/web/JsonpChunkLoadingPlugin.js +2 -2
- package/lib/web/JsonpChunkLoadingRuntimeModule.js +1 -1
- package/lib/webpack.js +17 -12
- package/lib/webworker/ImportScriptsChunkLoadingPlugin.js +2 -2
- package/lib/webworker/ImportScriptsChunkLoadingRuntimeModule.js +1 -1
- package/package.json +13 -13
- package/schemas/WebpackOptions.check.js +1 -1
- package/schemas/WebpackOptions.json +4 -0
- package/types.d.ts +151 -44
package/README.md
CHANGED
|
@@ -133,16 +133,6 @@ loaders](https://webpack.js.org/api/loaders/) using Node.js.
|
|
|
133
133
|
Loaders are activated by using `loadername!` prefixes in `require()` statements,
|
|
134
134
|
or are automatically applied via regex from your webpack configuration.
|
|
135
135
|
|
|
136
|
-
#### Files
|
|
137
|
-
|
|
138
|
-
| Name | Status | Install Size | Description |
|
|
139
|
-
| :---------------: | :--------: | :----------: | :------------------------------------------------------- |
|
|
140
|
-
| [val-loader][val] | ![val-npm] | ![val-size] | Executes code as module and considers exports as JS code |
|
|
141
|
-
|
|
142
|
-
[val]: https://github.com/webpack-contrib/val-loader
|
|
143
|
-
[val-npm]: https://img.shields.io/npm/v/val-loader.svg
|
|
144
|
-
[val-size]: https://packagephobia.com/badge?p=val-loader
|
|
145
|
-
|
|
146
136
|
#### JSON
|
|
147
137
|
|
|
148
138
|
| Name | Status | Install Size | Description |
|
|
@@ -262,6 +252,18 @@ you full control of what is loaded initially and what is loaded at runtime
|
|
|
262
252
|
through code splitting. It can also make your code chunks **cache
|
|
263
253
|
friendly** by using hashes.
|
|
264
254
|
|
|
255
|
+
### Developer Tools
|
|
256
|
+
|
|
257
|
+
If you're working on webpack itself, or building advanced plugins or integrations, the tools below can help you explore internal mechanics, debug plugin life-cycles, and build custom tooling.
|
|
258
|
+
|
|
259
|
+
#### Instrumentation
|
|
260
|
+
|
|
261
|
+
| Name | Status | Description |
|
|
262
|
+
| --------------------------------------------------------- | --------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
|
|
263
|
+
| [tapable-tracer](https://github.com/ertgl/tapable-tracer) | ![tapable-tracer-npm] | Traces tapable hook execution in real-time and collects structured stack frames. Can export to UML for generating visualizations. |
|
|
264
|
+
|
|
265
|
+
[tapable-tracer-npm]: https://img.shields.io/npm/v/tapable-tracer.svg
|
|
266
|
+
|
|
265
267
|
<h2>Contributing</h2>
|
|
266
268
|
|
|
267
269
|
**We want contributing to webpack to be fun, enjoyable, and educational for anyone, and everyone.** We have a [vibrant ecosystem](https://medium.com/webpack/contributors-guide/home) that spans beyond this single repo. We welcome you to check out any of the repositories in [our organization](https://github.com/webpack) or [webpack-contrib organization](https://github.com/webpack-contrib) which houses all of our loaders and plugins.
|
package/bin/webpack.js
CHANGED
|
@@ -16,11 +16,11 @@ const runCommand = (command, args) => {
|
|
|
16
16
|
shell: true
|
|
17
17
|
});
|
|
18
18
|
|
|
19
|
-
executedCommand.on("error", error => {
|
|
19
|
+
executedCommand.on("error", (error) => {
|
|
20
20
|
reject(error);
|
|
21
21
|
});
|
|
22
22
|
|
|
23
|
-
executedCommand.on("exit", code => {
|
|
23
|
+
executedCommand.on("exit", (code) => {
|
|
24
24
|
if (code === 0) {
|
|
25
25
|
resolve();
|
|
26
26
|
} else {
|
|
@@ -34,7 +34,7 @@ const runCommand = (command, args) => {
|
|
|
34
34
|
* @param {string} packageName name of the package
|
|
35
35
|
* @returns {boolean} is the package installed?
|
|
36
36
|
*/
|
|
37
|
-
const isInstalled = packageName => {
|
|
37
|
+
const isInstalled = (packageName) => {
|
|
38
38
|
if (process.versions.pnp) {
|
|
39
39
|
return true;
|
|
40
40
|
}
|
|
@@ -76,7 +76,7 @@ const isInstalled = packageName => {
|
|
|
76
76
|
* @param {CliOption} cli options
|
|
77
77
|
* @returns {void}
|
|
78
78
|
*/
|
|
79
|
-
const runCli = cli => {
|
|
79
|
+
const runCli = (cli) => {
|
|
80
80
|
const path = require("path");
|
|
81
81
|
|
|
82
82
|
const pkgPath = require.resolve(`${cli.package}/package.json`);
|
|
@@ -85,7 +85,7 @@ const runCli = cli => {
|
|
|
85
85
|
|
|
86
86
|
if (pkg.type === "module" || /\.mjs/i.test(pkg.bin[cli.binName])) {
|
|
87
87
|
import(path.resolve(path.dirname(pkgPath), pkg.bin[cli.binName])).catch(
|
|
88
|
-
err => {
|
|
88
|
+
(err) => {
|
|
89
89
|
console.error(err);
|
|
90
90
|
process.exitCode = 1;
|
|
91
91
|
}
|
|
@@ -152,7 +152,7 @@ if (!cli.installed) {
|
|
|
152
152
|
// executed. Setting the exit code here to ensure the script exits correctly in those cases. The callback
|
|
153
153
|
// function is responsible for clearing the exit code if the user wishes to install webpack-cli.
|
|
154
154
|
process.exitCode = 1;
|
|
155
|
-
questionInterface.question(question, answer => {
|
|
155
|
+
questionInterface.question(question, (answer) => {
|
|
156
156
|
questionInterface.close();
|
|
157
157
|
|
|
158
158
|
const normalizedAnswer = answer.toLowerCase().startsWith("y");
|
|
@@ -183,7 +183,7 @@ if (!cli.installed) {
|
|
|
183
183
|
.then(() => {
|
|
184
184
|
runCli(cli);
|
|
185
185
|
})
|
|
186
|
-
.catch(err => {
|
|
186
|
+
.catch((err) => {
|
|
187
187
|
console.error(err);
|
|
188
188
|
process.exitCode = 1;
|
|
189
189
|
});
|
package/lib/APIPlugin.js
CHANGED
|
@@ -169,7 +169,7 @@ class APIPlugin {
|
|
|
169
169
|
|
|
170
170
|
compilation.hooks.runtimeRequirementInTree
|
|
171
171
|
.for(RuntimeGlobals.chunkName)
|
|
172
|
-
.tap(PLUGIN_NAME, chunk => {
|
|
172
|
+
.tap(PLUGIN_NAME, (chunk) => {
|
|
173
173
|
compilation.addRuntimeModule(
|
|
174
174
|
chunk,
|
|
175
175
|
new ChunkNameRuntimeModule(/** @type {string} */ (chunk.name))
|
|
@@ -190,13 +190,11 @@ class APIPlugin {
|
|
|
190
190
|
PLUGIN_NAME,
|
|
191
191
|
(source, module, renderContext) => {
|
|
192
192
|
if (/** @type {BuildInfo} */ (module.buildInfo).needCreateRequire) {
|
|
193
|
-
const needPrefix =
|
|
194
|
-
renderContext.runtimeTemplate.supportNodePrefixForCoreModules();
|
|
195
193
|
const chunkInitFragments = [
|
|
196
194
|
new InitFragment(
|
|
197
|
-
`import { createRequire as __WEBPACK_EXTERNAL_createRequire } from
|
|
198
|
-
|
|
199
|
-
}
|
|
195
|
+
`import { createRequire as __WEBPACK_EXTERNAL_createRequire } from ${renderContext.runtimeTemplate.renderNodePrefixForCoreModule(
|
|
196
|
+
"module"
|
|
197
|
+
)};\n`,
|
|
200
198
|
InitFragment.STAGE_HARMONY_IMPORTS,
|
|
201
199
|
0,
|
|
202
200
|
"external module node-commonjs"
|
|
@@ -213,10 +211,10 @@ class APIPlugin {
|
|
|
213
211
|
/**
|
|
214
212
|
* @param {JavascriptParser} parser the parser
|
|
215
213
|
*/
|
|
216
|
-
const handler = parser => {
|
|
214
|
+
const handler = (parser) => {
|
|
217
215
|
for (const key of Object.keys(REPLACEMENTS)) {
|
|
218
216
|
const info = REPLACEMENTS[key];
|
|
219
|
-
parser.hooks.expression.for(key).tap(PLUGIN_NAME, expression => {
|
|
217
|
+
parser.hooks.expression.for(key).tap(PLUGIN_NAME, (expression) => {
|
|
220
218
|
const dep = toConstantDependency(parser, info.expr, info.req);
|
|
221
219
|
|
|
222
220
|
if (key === "__non_webpack_require__" && this.options.module) {
|
|
@@ -227,7 +225,7 @@ class APIPlugin {
|
|
|
227
225
|
return dep(expression);
|
|
228
226
|
});
|
|
229
227
|
if (info.assign === false) {
|
|
230
|
-
parser.hooks.assign.for(key).tap(PLUGIN_NAME, expr => {
|
|
228
|
+
parser.hooks.assign.for(key).tap(PLUGIN_NAME, (expr) => {
|
|
231
229
|
const err = new WebpackError(`${key} must not be assigned`);
|
|
232
230
|
err.loc = /** @type {DependencyLocation} */ (expr.loc);
|
|
233
231
|
throw err;
|
|
@@ -242,7 +240,7 @@ class APIPlugin {
|
|
|
242
240
|
|
|
243
241
|
parser.hooks.expression
|
|
244
242
|
.for("__webpack_layer__")
|
|
245
|
-
.tap(PLUGIN_NAME, expr => {
|
|
243
|
+
.tap(PLUGIN_NAME, (expr) => {
|
|
246
244
|
const dep = new ConstDependency(
|
|
247
245
|
JSON.stringify(parser.state.module.layer),
|
|
248
246
|
/** @type {Range} */ (expr.range)
|
|
@@ -253,7 +251,7 @@ class APIPlugin {
|
|
|
253
251
|
});
|
|
254
252
|
parser.hooks.evaluateIdentifier
|
|
255
253
|
.for("__webpack_layer__")
|
|
256
|
-
.tap(PLUGIN_NAME, expr =>
|
|
254
|
+
.tap(PLUGIN_NAME, (expr) =>
|
|
257
255
|
(parser.state.module.layer === null
|
|
258
256
|
? new BasicEvaluatedExpression().setNull()
|
|
259
257
|
: new BasicEvaluatedExpression().setString(
|
|
@@ -263,7 +261,7 @@ class APIPlugin {
|
|
|
263
261
|
);
|
|
264
262
|
parser.hooks.evaluateTypeof
|
|
265
263
|
.for("__webpack_layer__")
|
|
266
|
-
.tap(PLUGIN_NAME, expr =>
|
|
264
|
+
.tap(PLUGIN_NAME, (expr) =>
|
|
267
265
|
new BasicEvaluatedExpression()
|
|
268
266
|
.setString(
|
|
269
267
|
parser.state.module.layer === null ? "object" : "string"
|
|
@@ -273,7 +271,7 @@ class APIPlugin {
|
|
|
273
271
|
|
|
274
272
|
parser.hooks.expression
|
|
275
273
|
.for("__webpack_module__.id")
|
|
276
|
-
.tap(PLUGIN_NAME, expr => {
|
|
274
|
+
.tap(PLUGIN_NAME, (expr) => {
|
|
277
275
|
/** @type {BuildInfo} */
|
|
278
276
|
(parser.state.module.buildInfo).moduleConcatenationBailout =
|
|
279
277
|
"__webpack_module__.id";
|
|
@@ -289,7 +287,7 @@ class APIPlugin {
|
|
|
289
287
|
|
|
290
288
|
parser.hooks.expression
|
|
291
289
|
.for("__webpack_module__")
|
|
292
|
-
.tap(PLUGIN_NAME, expr => {
|
|
290
|
+
.tap(PLUGIN_NAME, (expr) => {
|
|
293
291
|
/** @type {BuildInfo} */
|
|
294
292
|
(parser.state.module.buildInfo).moduleConcatenationBailout =
|
|
295
293
|
"__webpack_module__";
|
|
@@ -31,7 +31,7 @@ class AutomaticPrefetchPlugin {
|
|
|
31
31
|
);
|
|
32
32
|
/** @type {{context: string | null, request: string}[] | null} */
|
|
33
33
|
let lastModules = null;
|
|
34
|
-
compiler.hooks.afterCompile.tap(PLUGIN_NAME, compilation => {
|
|
34
|
+
compiler.hooks.afterCompile.tap(PLUGIN_NAME, (compilation) => {
|
|
35
35
|
lastModules = [];
|
|
36
36
|
|
|
37
37
|
for (const m of compilation.modules) {
|
|
@@ -54,7 +54,7 @@ class AutomaticPrefetchPlugin {
|
|
|
54
54
|
callback
|
|
55
55
|
);
|
|
56
56
|
},
|
|
57
|
-
err => {
|
|
57
|
+
(err) => {
|
|
58
58
|
lastModules = null;
|
|
59
59
|
callback(err);
|
|
60
60
|
}
|
package/lib/BannerPlugin.js
CHANGED
|
@@ -32,7 +32,7 @@ const validate = createSchemaValidation(
|
|
|
32
32
|
* @param {string} str string to wrap
|
|
33
33
|
* @returns {string} wrapped string
|
|
34
34
|
*/
|
|
35
|
-
const wrapComment = str => {
|
|
35
|
+
const wrapComment = (str) => {
|
|
36
36
|
if (!str.includes("\n")) {
|
|
37
37
|
return Template.toComment(str);
|
|
38
38
|
}
|
|
@@ -67,7 +67,7 @@ class BannerPlugin {
|
|
|
67
67
|
/** @type {BannerFunction} */
|
|
68
68
|
this.banner = this.options.raw
|
|
69
69
|
? getBanner
|
|
70
|
-
: /** @type {BannerFunction} */ data => wrapComment(getBanner(data));
|
|
70
|
+
: /** @type {BannerFunction} */ (data) => wrapComment(getBanner(data));
|
|
71
71
|
} else {
|
|
72
72
|
const banner = this.options.raw
|
|
73
73
|
? bannerOption
|
|
@@ -93,7 +93,7 @@ class BannerPlugin {
|
|
|
93
93
|
const stage =
|
|
94
94
|
this.options.stage || Compilation.PROCESS_ASSETS_STAGE_ADDITIONS;
|
|
95
95
|
|
|
96
|
-
compiler.hooks.compilation.tap(PLUGIN_NAME, compilation => {
|
|
96
|
+
compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation) => {
|
|
97
97
|
compilation.hooks.processAssets.tap({ name: PLUGIN_NAME, stage }, () => {
|
|
98
98
|
for (const chunk of compilation.chunks) {
|
|
99
99
|
if (options.entryOnly && !chunk.canBeInitial()) {
|
|
@@ -114,7 +114,7 @@ class BannerPlugin {
|
|
|
114
114
|
data
|
|
115
115
|
);
|
|
116
116
|
|
|
117
|
-
compilation.updateAsset(file, old => {
|
|
117
|
+
compilation.updateAsset(file, (old) => {
|
|
118
118
|
const cached = cache.get(old);
|
|
119
119
|
if (!cached || cached.comment !== comment) {
|
|
120
120
|
const source = options.footer
|
package/lib/Cache.js
CHANGED
|
@@ -40,7 +40,7 @@ const {
|
|
|
40
40
|
* @param {(err?: Error) => void} callback callback
|
|
41
41
|
* @returns {(err?: Error) => void} callback
|
|
42
42
|
*/
|
|
43
|
-
const needCalls = (times, callback) => err => {
|
|
43
|
+
const needCalls = (times, callback) => (err) => {
|
|
44
44
|
if (--times === 0) {
|
|
45
45
|
return callback(err);
|
|
46
46
|
}
|
package/lib/CacheFacade.js
CHANGED
|
@@ -61,8 +61,8 @@ class MultiItemCache {
|
|
|
61
61
|
* @param {number} i index
|
|
62
62
|
* @returns {Promise<T>} promise with the data
|
|
63
63
|
*/
|
|
64
|
-
const next = i =>
|
|
65
|
-
this._items[i].getPromise().then(result => {
|
|
64
|
+
const next = (i) =>
|
|
65
|
+
this._items[i].getPromise().then((result) => {
|
|
66
66
|
if (result !== undefined) return result;
|
|
67
67
|
if (++i < this._items.length) return next(i);
|
|
68
68
|
});
|
|
@@ -89,7 +89,7 @@ class MultiItemCache {
|
|
|
89
89
|
* @returns {Promise<void>} promise signals when the value is stored
|
|
90
90
|
*/
|
|
91
91
|
storePromise(data) {
|
|
92
|
-
return Promise.all(this._items.map(item => item.storePromise(data))).then(
|
|
92
|
+
return Promise.all(this._items.map((item) => item.storePromise(data))).then(
|
|
93
93
|
() => {}
|
|
94
94
|
);
|
|
95
95
|
}
|
|
@@ -149,7 +149,7 @@ class ItemCacheFacade {
|
|
|
149
149
|
*/
|
|
150
150
|
storePromise(data) {
|
|
151
151
|
return new Promise((resolve, reject) => {
|
|
152
|
-
this._cache.store(this._name, this._etag, data, err => {
|
|
152
|
+
this._cache.store(this._name, this._etag, data, (err) => {
|
|
153
153
|
if (err) {
|
|
154
154
|
reject(err);
|
|
155
155
|
} else {
|
|
@@ -171,7 +171,7 @@ class ItemCacheFacade {
|
|
|
171
171
|
if (cacheEntry !== undefined) return cacheEntry;
|
|
172
172
|
computer((err, result) => {
|
|
173
173
|
if (err) return callback(err);
|
|
174
|
-
this.store(result, err => {
|
|
174
|
+
this.store(result, (err) => {
|
|
175
175
|
if (err) return callback(err);
|
|
176
176
|
callback(null, result);
|
|
177
177
|
});
|
|
@@ -297,7 +297,7 @@ class CacheFacade {
|
|
|
297
297
|
*/
|
|
298
298
|
storePromise(identifier, etag, data) {
|
|
299
299
|
return new Promise((resolve, reject) => {
|
|
300
|
-
this._cache.store(`${this._name}|${identifier}`, etag, data, err => {
|
|
300
|
+
this._cache.store(`${this._name}|${identifier}`, etag, data, (err) => {
|
|
301
301
|
if (err) {
|
|
302
302
|
reject(err);
|
|
303
303
|
} else {
|
|
@@ -321,7 +321,7 @@ class CacheFacade {
|
|
|
321
321
|
if (cacheEntry !== undefined) return cacheEntry;
|
|
322
322
|
computer((err, result) => {
|
|
323
323
|
if (err) return callback(err);
|
|
324
|
-
this.store(identifier, etag, result, err => {
|
|
324
|
+
this.store(identifier, etag, result, (err) => {
|
|
325
325
|
if (err) return callback(err);
|
|
326
326
|
callback(null, result);
|
|
327
327
|
});
|
|
@@ -14,7 +14,7 @@ const WebpackError = require("./WebpackError");
|
|
|
14
14
|
* @param {Module[]} modules the modules to be sorted
|
|
15
15
|
* @returns {Module[]} sorted version of original modules
|
|
16
16
|
*/
|
|
17
|
-
const sortModules = modules =>
|
|
17
|
+
const sortModules = (modules) =>
|
|
18
18
|
modules.sort((a, b) => {
|
|
19
19
|
const aIdent = a.identifier();
|
|
20
20
|
const bIdent = b.identifier();
|
|
@@ -33,7 +33,7 @@ const sortModules = modules =>
|
|
|
33
33
|
*/
|
|
34
34
|
const createModulesListMessage = (modules, moduleGraph) =>
|
|
35
35
|
modules
|
|
36
|
-
.map(m => {
|
|
36
|
+
.map((m) => {
|
|
37
37
|
let message = `* ${m.identifier()}`;
|
|
38
38
|
const validReasons = [
|
|
39
39
|
...moduleGraph.getIncomingConnectionsByOriginModule(m).keys()
|
package/lib/Chunk.js
CHANGED
|
@@ -583,7 +583,7 @@ class Chunk {
|
|
|
583
583
|
const chunks = new Set();
|
|
584
584
|
|
|
585
585
|
const initialChunks = intersect(
|
|
586
|
-
Array.from(this.groupsIterable, g => new Set(g.chunks))
|
|
586
|
+
Array.from(this.groupsIterable, (g) => new Set(g.chunks))
|
|
587
587
|
);
|
|
588
588
|
|
|
589
589
|
const initialQueue = new Set(this.groupsIterable);
|
|
@@ -672,7 +672,7 @@ class Chunk {
|
|
|
672
672
|
const queue = new Set();
|
|
673
673
|
|
|
674
674
|
const initialChunks = intersect(
|
|
675
|
-
Array.from(this.groupsIterable, g => new Set(g.chunks))
|
|
675
|
+
Array.from(this.groupsIterable, (g) => new Set(g.chunks))
|
|
676
676
|
);
|
|
677
677
|
|
|
678
678
|
for (const chunkGroup of this.groupsIterable) {
|
|
@@ -812,7 +812,7 @@ class Chunk {
|
|
|
812
812
|
* @param {Chunk} chunk a chunk
|
|
813
813
|
* @returns {void}
|
|
814
814
|
*/
|
|
815
|
-
const addChildIdsByOrdersToMap = chunk => {
|
|
815
|
+
const addChildIdsByOrdersToMap = (chunk) => {
|
|
816
816
|
const data = chunk.getChildIdsByOrders(chunkGraph, filterFn);
|
|
817
817
|
for (const key of Object.keys(data)) {
|
|
818
818
|
let chunkMap = chunkMaps[key];
|
package/lib/ChunkGraph.js
CHANGED
|
@@ -76,13 +76,13 @@ class ModuleHashInfo {
|
|
|
76
76
|
* @param {SortableSet<T>} set the set
|
|
77
77
|
* @returns {T[]} set as array
|
|
78
78
|
*/
|
|
79
|
-
const getArray = set => [...set];
|
|
79
|
+
const getArray = (set) => [...set];
|
|
80
80
|
|
|
81
81
|
/**
|
|
82
82
|
* @param {SortableSet<Chunk>} chunks the chunks
|
|
83
83
|
* @returns {RuntimeSpecSet} runtimes
|
|
84
84
|
*/
|
|
85
|
-
const getModuleRuntimes = chunks => {
|
|
85
|
+
const getModuleRuntimes = (chunks) => {
|
|
86
86
|
const runtimes = new RuntimeSpecSet();
|
|
87
87
|
for (const chunk of chunks) {
|
|
88
88
|
runtimes.add(chunk.runtime);
|
|
@@ -94,7 +94,7 @@ const getModuleRuntimes = chunks => {
|
|
|
94
94
|
* @param {WeakMap<Module, Set<string>> | undefined} sourceTypesByModule sourceTypesByModule
|
|
95
95
|
* @returns {(set: SortableSet<Module>) => Map<string, SortableSet<Module>>} modules by source type
|
|
96
96
|
*/
|
|
97
|
-
const modulesBySourceType = sourceTypesByModule => set => {
|
|
97
|
+
const modulesBySourceType = (sourceTypesByModule) => (set) => {
|
|
98
98
|
/** @type {Map<string, SortableSet<Module>>} */
|
|
99
99
|
const map = new Map();
|
|
100
100
|
for (const module of set) {
|
|
@@ -136,10 +136,10 @@ const createOrderedArrayFunctionMap = new WeakMap();
|
|
|
136
136
|
* @param {ModuleComparator} comparator comparator function
|
|
137
137
|
* @returns {ModuleSetToArrayFunction} set as ordered array
|
|
138
138
|
*/
|
|
139
|
-
const createOrderedArrayFunction = comparator => {
|
|
139
|
+
const createOrderedArrayFunction = (comparator) => {
|
|
140
140
|
let fn = createOrderedArrayFunctionMap.get(comparator);
|
|
141
141
|
if (fn !== undefined) return fn;
|
|
142
|
-
fn = set => {
|
|
142
|
+
fn = (set) => {
|
|
143
143
|
set.sortWith(comparator);
|
|
144
144
|
return [...set];
|
|
145
145
|
};
|
|
@@ -151,7 +151,7 @@ const createOrderedArrayFunction = comparator => {
|
|
|
151
151
|
* @param {Iterable<Module>} modules the modules to get the count/size of
|
|
152
152
|
* @returns {number} the size of the modules
|
|
153
153
|
*/
|
|
154
|
-
const getModulesSize = modules => {
|
|
154
|
+
const getModulesSize = (modules) => {
|
|
155
155
|
let size = 0;
|
|
156
156
|
for (const module of modules) {
|
|
157
157
|
for (const type of module.getSourceTypes()) {
|
|
@@ -165,7 +165,7 @@ const getModulesSize = modules => {
|
|
|
165
165
|
* @param {Iterable<Module>} modules the sortable Set to get the size of
|
|
166
166
|
* @returns {Record<string, number>} the sizes of the modules
|
|
167
167
|
*/
|
|
168
|
-
const getModulesSizes = modules => {
|
|
168
|
+
const getModulesSizes = (modules) => {
|
|
169
169
|
const sizes = Object.create(null);
|
|
170
170
|
for (const module of modules) {
|
|
171
171
|
for (const type of module.getSourceTypes()) {
|
|
@@ -311,13 +311,13 @@ class ChunkGraph {
|
|
|
311
311
|
_getGraphRoots(set) {
|
|
312
312
|
const { moduleGraph } = this;
|
|
313
313
|
return [
|
|
314
|
-
...findGraphRoots(set, module => {
|
|
314
|
+
...findGraphRoots(set, (module) => {
|
|
315
315
|
/** @type {Set<Module>} */
|
|
316
316
|
const set = new Set();
|
|
317
317
|
/**
|
|
318
318
|
* @param {Module} module module
|
|
319
319
|
*/
|
|
320
|
-
const addDependencies = module => {
|
|
320
|
+
const addDependencies = (module) => {
|
|
321
321
|
for (const connection of moduleGraph.getOutgoingConnections(module)) {
|
|
322
322
|
if (!connection.module) continue;
|
|
323
323
|
const activeState = connection.getActiveState(undefined);
|
|
@@ -1272,7 +1272,10 @@ class ChunkGraph {
|
|
|
1272
1272
|
const array = [...cgc.runtimeModules];
|
|
1273
1273
|
array.sort(
|
|
1274
1274
|
concatComparators(
|
|
1275
|
-
compareSelect(
|
|
1275
|
+
compareSelect(
|
|
1276
|
+
(r) => /** @type {RuntimeModule} */ (r).stage,
|
|
1277
|
+
compareIds
|
|
1278
|
+
),
|
|
1276
1279
|
compareModulesByIdentifier
|
|
1277
1280
|
)
|
|
1278
1281
|
);
|
|
@@ -1401,7 +1404,7 @@ class ChunkGraph {
|
|
|
1401
1404
|
throw new Error(
|
|
1402
1405
|
`No unique hash info entry for unspecified runtime for ${module.identifier()} (existing runtimes: ${Array.from(
|
|
1403
1406
|
hashes.keys(),
|
|
1404
|
-
r => runtimeToString(r)
|
|
1407
|
+
(r) => runtimeToString(r)
|
|
1405
1408
|
).join(", ")}).
|
|
1406
1409
|
Caller might not support runtime-dependent code generation (opt-out via optimization.usedExports: "global").`
|
|
1407
1410
|
);
|
|
@@ -1493,7 +1496,7 @@ Caller might not support runtime-dependent code generation (opt-out via optimiza
|
|
|
1493
1496
|
cgm.runtimeRequirements = map;
|
|
1494
1497
|
return;
|
|
1495
1498
|
}
|
|
1496
|
-
runtimeRequirementsMap.update(runtime, runtimeRequirements => {
|
|
1499
|
+
runtimeRequirementsMap.update(runtime, (runtimeRequirements) => {
|
|
1497
1500
|
if (runtimeRequirements === undefined) {
|
|
1498
1501
|
return transferOwnership ? items : new Set(items);
|
|
1499
1502
|
} else if (!transferOwnership || runtimeRequirements.size >= items.size) {
|
|
@@ -1623,7 +1626,7 @@ Caller might not support runtime-dependent code generation (opt-out via optimiza
|
|
|
1623
1626
|
* @param {ConnectionState} state state
|
|
1624
1627
|
* @returns {"F" | "T" | "O"} result
|
|
1625
1628
|
*/
|
|
1626
|
-
const activeStateToString = state => {
|
|
1629
|
+
const activeStateToString = (state) => {
|
|
1627
1630
|
if (state === false) return "F";
|
|
1628
1631
|
if (state === true) return "T";
|
|
1629
1632
|
if (state === ModuleGraphConnection.TRANSITIVE_ONLY) return "O";
|
|
@@ -1675,7 +1678,7 @@ Caller might not support runtime-dependent code generation (opt-out via optimiza
|
|
|
1675
1678
|
let stateInfo = "";
|
|
1676
1679
|
forEachRuntime(
|
|
1677
1680
|
runtime,
|
|
1678
|
-
runtime => {
|
|
1681
|
+
(runtime) => {
|
|
1679
1682
|
const state = connection.getActiveState(runtime);
|
|
1680
1683
|
states.add(state);
|
|
1681
1684
|
stateInfo += activeStateToString(state) + runtime;
|
|
@@ -1702,7 +1705,7 @@ Caller might not support runtime-dependent code generation (opt-out via optimiza
|
|
|
1702
1705
|
/**
|
|
1703
1706
|
* @param {Module} module module
|
|
1704
1707
|
*/
|
|
1705
|
-
const addModuleToHash = module => {
|
|
1708
|
+
const addModuleToHash = (module) => {
|
|
1706
1709
|
hash.update(
|
|
1707
1710
|
this._getModuleGraphHashBigInt(
|
|
1708
1711
|
this._getChunkGraphModule(module),
|
|
@@ -1714,7 +1717,7 @@ Caller might not support runtime-dependent code generation (opt-out via optimiza
|
|
|
1714
1717
|
/**
|
|
1715
1718
|
* @param {Set<Module>} modules modules
|
|
1716
1719
|
*/
|
|
1717
|
-
const addModulesToHash = modules => {
|
|
1720
|
+
const addModulesToHash = (modules) => {
|
|
1718
1721
|
let xor = ZERO_BIG_INT;
|
|
1719
1722
|
for (const m of modules) {
|
|
1720
1723
|
xor ^= this._getModuleGraphHashBigInt(
|
|
@@ -1769,7 +1772,7 @@ Caller might not support runtime-dependent code generation (opt-out via optimiza
|
|
|
1769
1772
|
* @param {Module} module the module
|
|
1770
1773
|
* @returns {ChunkGraph} the chunk graph
|
|
1771
1774
|
*/
|
|
1772
|
-
module => {
|
|
1775
|
+
(module) => {
|
|
1773
1776
|
const chunkGraph = chunkGraphForModuleMap.get(module);
|
|
1774
1777
|
if (!chunkGraph) {
|
|
1775
1778
|
throw new Error(
|
|
@@ -1821,7 +1824,7 @@ Caller might not support runtime-dependent code generation (opt-out via optimiza
|
|
|
1821
1824
|
* @param {Chunk} chunk the chunk
|
|
1822
1825
|
* @returns {ChunkGraph} the chunk graph
|
|
1823
1826
|
*/
|
|
1824
|
-
chunk => {
|
|
1827
|
+
(chunk) => {
|
|
1825
1828
|
const chunkGraph = chunkGraphForChunkMap.get(chunk);
|
|
1826
1829
|
if (!chunkGraph) {
|
|
1827
1830
|
throw new Error(
|
package/lib/ChunkGroup.js
CHANGED
|
@@ -40,7 +40,7 @@ let debugId = 5000;
|
|
|
40
40
|
* @param {SortableSet<T>} set set to convert to array.
|
|
41
41
|
* @returns {T[]} the array format of existing set
|
|
42
42
|
*/
|
|
43
|
-
const getArray = set => [...set];
|
|
43
|
+
const getArray = (set) => [...set];
|
|
44
44
|
|
|
45
45
|
/**
|
|
46
46
|
* A convenience method used to sort chunks based on their id's
|
|
@@ -165,7 +165,7 @@ class ChunkGroup {
|
|
|
165
165
|
* @returns {string} a unique concatenation of chunk debugId's
|
|
166
166
|
*/
|
|
167
167
|
get debugId() {
|
|
168
|
-
return Array.from(this.chunks, x => x.debugId).join("+");
|
|
168
|
+
return Array.from(this.chunks, (x) => x.debugId).join("+");
|
|
169
169
|
}
|
|
170
170
|
|
|
171
171
|
/**
|
|
@@ -173,7 +173,7 @@ class ChunkGroup {
|
|
|
173
173
|
* @returns {string} a unique concatenation of chunk ids
|
|
174
174
|
*/
|
|
175
175
|
get id() {
|
|
176
|
-
return Array.from(this.chunks, x => x.id).join("+");
|
|
176
|
+
return Array.from(this.chunks, (x) => x.id).join("+");
|
|
177
177
|
}
|
|
178
178
|
|
|
179
179
|
/**
|
|
@@ -533,7 +533,7 @@ class ChunkGroup {
|
|
|
533
533
|
if (cmp !== 0) return cmp;
|
|
534
534
|
return a.group.compareTo(chunkGraph, b.group);
|
|
535
535
|
});
|
|
536
|
-
result[name] = list.map(i => i.group);
|
|
536
|
+
result[name] = list.map((i) => i.group);
|
|
537
537
|
}
|
|
538
538
|
return result;
|
|
539
539
|
}
|