@rspack/core 1.0.9 → 1.0.11
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/dist/Dependency.d.ts +7 -6
- package/dist/Module.d.ts +19 -17
- package/dist/builtin-plugin/css-extract/utils.d.ts +1 -0
- package/dist/config/types.d.ts +545 -0
- package/dist/config/zod.d.ts +202 -1347
- package/dist/cssExtractHmr.js +224 -0
- package/dist/cssExtractLoader.js +277 -0
- package/dist/index.js +23347 -31
- package/dist/{builtin-plugin/css-extract/hmr/hotModuleReplacement.d.ts → runtime/cssExtractHmr.d.ts} +1 -0
- package/dist/runtime/moduleFederationDefaultRuntime.d.ts +2 -0
- package/dist/stats/statsFactoryUtils.d.ts +1 -0
- package/package.json +8 -5
- package/compiled/json-parse-even-better-errors/index.d.ts +0 -1
- package/compiled/json-parse-even-better-errors/index.js +0 -193
- package/compiled/json-parse-even-better-errors/package.json +0 -1
- package/compiled/neo-async/index.d.ts +0 -685
- package/compiled/neo-async/index.js +0 -9207
- package/compiled/neo-async/license +0 -22
- package/compiled/neo-async/package.json +0 -1
- package/compiled/zod-validation-error/index.d.ts +0 -41
- package/compiled/zod-validation-error/index.js +0 -335
- package/compiled/zod-validation-error/license +0 -9
- package/compiled/zod-validation-error/package.json +0 -1
- package/dist/Chunk.js +0 -118
- package/dist/ChunkGraph.js +0 -27
- package/dist/ChunkGroup.js +0 -76
- package/dist/Compilation.js +0 -854
- package/dist/Compiler.js +0 -920
- package/dist/ContextModuleFactory.js +0 -36
- package/dist/DependenciesBlock.js +0 -30
- package/dist/Dependency.js +0 -32
- package/dist/Entrypoint.js +0 -21
- package/dist/ErrorHelpers.js +0 -62
- package/dist/ExecuteModulePlugin.js +0 -46
- package/dist/FileSystem.js +0 -34
- package/dist/FileSystemInfo.js +0 -2
- package/dist/Module.js +0 -143
- package/dist/ModuleTypeConstants.js +0 -92
- package/dist/MultiCompiler.js +0 -440
- package/dist/MultiStats.js +0 -161
- package/dist/MultiWatching.js +0 -62
- package/dist/NormalModule.js +0 -97
- package/dist/NormalModuleFactory.js +0 -43
- package/dist/Resolver.js +0 -39
- package/dist/ResolverFactory.js +0 -61
- package/dist/RspackError.js +0 -21
- package/dist/RuleSetCompiler.js +0 -10
- package/dist/RuntimeGlobals.js +0 -357
- package/dist/RuntimeModule.js +0 -58
- package/dist/Stats.js +0 -161
- package/dist/Template.js +0 -206
- package/dist/Watching.js +0 -290
- package/dist/builtin-loader/index.js +0 -17
- package/dist/builtin-loader/lightningcss/index.js +0 -175
- package/dist/builtin-loader/swc/index.js +0 -5
- package/dist/builtin-loader/swc/pluginImport.js +0 -35
- package/dist/builtin-loader/swc/react.js +0 -7
- package/dist/builtin-loader/swc/types.js +0 -2
- package/dist/builtin-plugin/APIPlugin.js +0 -6
- package/dist/builtin-plugin/ArrayPushCallbackChunkFormatPlugin.js +0 -6
- package/dist/builtin-plugin/AssetModulesPlugin.js +0 -6
- package/dist/builtin-plugin/AsyncWebAssemblyModulesPlugin.js +0 -6
- package/dist/builtin-plugin/BannerPlugin.js +0 -22
- package/dist/builtin-plugin/BundlerInfoRspackPlugin.js +0 -12
- package/dist/builtin-plugin/ChunkPrefetchPreloadPlugin.js +0 -6
- package/dist/builtin-plugin/CommonJsChunkFormatPlugin.js +0 -6
- package/dist/builtin-plugin/ContextReplacementPlugin.js +0 -43
- package/dist/builtin-plugin/CopyRspackPlugin.js +0 -21
- package/dist/builtin-plugin/CssModulesPlugin.js +0 -6
- package/dist/builtin-plugin/DataUriPlugin.js +0 -6
- package/dist/builtin-plugin/DefinePlugin.js +0 -44
- package/dist/builtin-plugin/DeterministicChunkIdsPlugin.js +0 -6
- package/dist/builtin-plugin/DeterministicModuleIdsPlugin.js +0 -6
- package/dist/builtin-plugin/DynamicEntryPlugin.js +0 -36
- package/dist/builtin-plugin/ElectronTargetPlugin.js +0 -6
- package/dist/builtin-plugin/EnableChunkLoadingPlugin.js +0 -6
- package/dist/builtin-plugin/EnableLibraryPlugin.js +0 -39
- package/dist/builtin-plugin/EnableWasmLoadingPlugin.js +0 -6
- package/dist/builtin-plugin/EnsureChunkConditionsPlugin.js +0 -6
- package/dist/builtin-plugin/EntryPlugin.js +0 -34
- package/dist/builtin-plugin/EvalDevToolModulePlugin.js +0 -6
- package/dist/builtin-plugin/EvalSourceMapDevToolPlugin.js +0 -16
- package/dist/builtin-plugin/ExternalsPlugin.js +0 -51
- package/dist/builtin-plugin/FetchCompileAsyncWasmPlugin.js +0 -6
- package/dist/builtin-plugin/FileUriPlugin.js +0 -6
- package/dist/builtin-plugin/FlagDependencyExportsPlugin.js +0 -6
- package/dist/builtin-plugin/FlagDependencyUsagePlugin.js +0 -6
- package/dist/builtin-plugin/HotModuleReplacementPlugin.js +0 -18
- package/dist/builtin-plugin/HtmlRspackPlugin.js +0 -285
- package/dist/builtin-plugin/HttpExternalsRspackPlugin.js +0 -11
- package/dist/builtin-plugin/IgnorePlugin.js +0 -20
- package/dist/builtin-plugin/InferAsyncModulesPlugin.js +0 -6
- package/dist/builtin-plugin/JavascriptModulesPlugin.js +0 -55
- package/dist/builtin-plugin/JsLoaderRspackPlugin.js +0 -9
- package/dist/builtin-plugin/JsonModulesPlugin.js +0 -6
- package/dist/builtin-plugin/LightningCssMiminizerRspackPlugin.js +0 -30
- package/dist/builtin-plugin/LimitChunkCountPlugin.js +0 -8
- package/dist/builtin-plugin/MangleExportsPlugin.js +0 -6
- package/dist/builtin-plugin/MergeDuplicateChunksPlugin.js +0 -6
- package/dist/builtin-plugin/ModuleChunkFormatPlugin.js +0 -6
- package/dist/builtin-plugin/ModuleConcatenationPlugin.js +0 -6
- package/dist/builtin-plugin/NamedChunkIdsPlugin.js +0 -6
- package/dist/builtin-plugin/NamedModuleIdsPlugin.js +0 -6
- package/dist/builtin-plugin/NaturalChunkIdsPlugin.js +0 -6
- package/dist/builtin-plugin/NaturalModuleIdsPlugin.js +0 -6
- package/dist/builtin-plugin/NoEmitOnErrorsPlugin.js +0 -6
- package/dist/builtin-plugin/NodeTargetPlugin.js +0 -6
- package/dist/builtin-plugin/ProgressPlugin.js +0 -15
- package/dist/builtin-plugin/ProvidePlugin.js +0 -14
- package/dist/builtin-plugin/RealContentHashPlugin.js +0 -6
- package/dist/builtin-plugin/RemoveEmptyChunksPlugin.js +0 -6
- package/dist/builtin-plugin/RuntimeChunkPlugin.js +0 -6
- package/dist/builtin-plugin/RuntimePlugin.js +0 -6
- package/dist/builtin-plugin/SideEffectsFlagPlugin.js +0 -6
- package/dist/builtin-plugin/SizeLimitsPlugin.js +0 -9
- package/dist/builtin-plugin/SourceMapDevToolPlugin.js +0 -14
- package/dist/builtin-plugin/SplitChunksPlugin.js +0 -92
- package/dist/builtin-plugin/SwcJsMinimizerPlugin.js +0 -80
- package/dist/builtin-plugin/WarnCaseSensitiveModulesPlugin.js +0 -6
- package/dist/builtin-plugin/WebWorkerTemplatePlugin.js +0 -6
- package/dist/builtin-plugin/WorkerPlugin.js +0 -31
- package/dist/builtin-plugin/base.js +0 -58
- package/dist/builtin-plugin/css-extract/hmr/hotModuleReplacement.js +0 -182
- package/dist/builtin-plugin/css-extract/hmr/normalizeUrl.d.ts +0 -2
- package/dist/builtin-plugin/css-extract/hmr/normalizeUrl.js +0 -31
- package/dist/builtin-plugin/css-extract/index.js +0 -105
- package/dist/builtin-plugin/css-extract/loader.js +0 -204
- package/dist/builtin-plugin/css-extract/utils.js +0 -51
- package/dist/builtin-plugin/index.js +0 -84
- package/dist/builtin-plugin/lazy-compilation/backend.js +0 -139
- package/dist/builtin-plugin/lazy-compilation/lazyCompilation.js +0 -6
- package/dist/builtin-plugin/lazy-compilation/plugin.js +0 -60
- package/dist/config/adapter.js +0 -691
- package/dist/config/adapterRuleUse.js +0 -107
- package/dist/config/browserslistTargetHandler.js +0 -345
- package/dist/config/defaults.js +0 -876
- package/dist/config/index.js +0 -20
- package/dist/config/normalization.js +0 -299
- package/dist/config/target.js +0 -318
- package/dist/config/types.js +0 -3
- package/dist/config/zod.js +0 -1028
- package/dist/container/ContainerPlugin.js +0 -50
- package/dist/container/ContainerReferencePlugin.js +0 -49
- package/dist/container/ModuleFederationPlugin.js +0 -137
- package/dist/container/ModuleFederationPluginV1.js +0 -63
- package/dist/container/ModuleFederationRuntimePlugin.js +0 -6
- package/dist/container/options.js +0 -48
- package/dist/error/ConcurrentCompilationError.js +0 -20
- package/dist/exports.js +0 -183
- package/dist/lib/AbstractMethodError.js +0 -51
- package/dist/lib/Cache.js +0 -111
- package/dist/lib/CacheFacade.js +0 -321
- package/dist/lib/Dependency.js +0 -11
- package/dist/lib/EntryOptionPlugin.js +0 -89
- package/dist/lib/EnvironmentPlugin.js +0 -57
- package/dist/lib/HookWebpackError.js +0 -83
- package/dist/lib/IgnoreWarningsPlugin.js +0 -35
- package/dist/lib/LoaderOptionsPlugin.js +0 -74
- package/dist/lib/LoaderTargetPlugin.js +0 -37
- package/dist/lib/ModuleFilenameHelpers.js +0 -83
- package/dist/lib/NormalModuleReplacementPlugin.js +0 -85
- package/dist/lib/WebpackError.js +0 -20
- package/dist/lib/cache/MemoryCachePlugin.js +0 -40
- package/dist/lib/cache/getLazyHashedEtag.js +0 -73
- package/dist/lib/cache/mergeEtags.js +0 -74
- package/dist/lib/formatLocation.js +0 -64
- package/dist/loader-runner/LoaderLoadingError.js +0 -19
- package/dist/loader-runner/index.js +0 -735
- package/dist/loader-runner/loadLoader.js +0 -64
- package/dist/logging/Logger.js +0 -143
- package/dist/logging/createConsoleLogger.js +0 -176
- package/dist/logging/runtime.js +0 -37
- package/dist/logging/truncateArgs.js +0 -81
- package/dist/node/NodeEnvironmentPlugin.js +0 -50
- package/dist/node/NodeTemplatePlugin.js +0 -26
- package/dist/node/NodeWatchFileSystem.js +0 -144
- package/dist/node/nodeConsole.js +0 -146
- package/dist/rspack.js +0 -123
- package/dist/rspackOptionsApply.js +0 -274
- package/dist/sharing/ConsumeSharedPlugin.js +0 -69
- package/dist/sharing/ProvideSharedPlugin.js +0 -50
- package/dist/sharing/SharePlugin.js +0 -66
- package/dist/sharing/ShareRuntimePlugin.js +0 -26
- package/dist/sharing/utils.js +0 -8
- package/dist/stats/DefaultStatsFactoryPlugin.js +0 -1173
- package/dist/stats/DefaultStatsPresetPlugin.js +0 -305
- package/dist/stats/DefaultStatsPrinterPlugin.js +0 -1069
- package/dist/stats/StatsFactory.js +0 -167
- package/dist/stats/StatsPrinter.js +0 -142
- package/dist/stats/statsFactoryUtils.js +0 -341
- package/dist/util/ArrayQueue.js +0 -108
- package/dist/util/AssetInfo.js +0 -39
- package/dist/util/IterableHelpers.js +0 -35
- package/dist/util/MergeCaller.js +0 -24
- package/dist/util/SizeFormatHelpers.js +0 -24
- package/dist/util/SplitChunkSize.js +0 -18
- package/dist/util/assertNotNil.js +0 -9
- package/dist/util/assetCondition.js +0 -2
- package/dist/util/bindingVersionCheck.js +0 -124
- package/dist/util/cleverMerge.js +0 -504
- package/dist/util/comparators.js +0 -108
- package/dist/util/createHash.js +0 -161
- package/dist/util/createReadonlyMap.js +0 -29
- package/dist/util/fake.js +0 -28
- package/dist/util/fs.js +0 -120
- package/dist/util/hash/BatchedHash.js +0 -69
- package/dist/util/hash/index.js +0 -39
- package/dist/util/hash/md4.js +0 -27
- package/dist/util/hash/wasm-hash.js +0 -167
- package/dist/util/hash/xxhash64.js +0 -27
- package/dist/util/identifier.js +0 -330
- package/dist/util/index.js +0 -123
- package/dist/util/memoize.js +0 -61
- package/dist/util/scheme.js +0 -57
- package/dist/util/smartGrouping.js +0 -148
- package/dist/util/source.js +0 -42
- package/dist/util/validate.js +0 -77
- package/dist/util/webpack.js +0 -27
- /package/dist/{container/default.runtime.js → moduleFederationDefaultRuntime.js} +0 -0
|
@@ -1,305 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
MIT License http://www.opensource.org/licenses/mit-license.php
|
|
4
|
-
Author Tobias Koppers @sokra
|
|
5
|
-
*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.DefaultStatsPresetPlugin = void 0;
|
|
8
|
-
const applyDefaults = (options, defaults) => {
|
|
9
|
-
for (const key of Object.keys(defaults)) {
|
|
10
|
-
if (typeof options[key] === "undefined") {
|
|
11
|
-
options[key] = defaults[key];
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
const NAMED_PRESETS = {
|
|
16
|
-
verbose: {
|
|
17
|
-
hash: true,
|
|
18
|
-
builtAt: true,
|
|
19
|
-
relatedAssets: true,
|
|
20
|
-
entrypoints: true,
|
|
21
|
-
chunkGroups: true,
|
|
22
|
-
ids: true,
|
|
23
|
-
modules: false,
|
|
24
|
-
chunks: true,
|
|
25
|
-
chunkRelations: true,
|
|
26
|
-
chunkModules: true,
|
|
27
|
-
dependentModules: true,
|
|
28
|
-
chunkOrigins: true,
|
|
29
|
-
depth: true,
|
|
30
|
-
env: true,
|
|
31
|
-
reasons: true,
|
|
32
|
-
usedExports: true,
|
|
33
|
-
providedExports: true,
|
|
34
|
-
optimizationBailout: true,
|
|
35
|
-
errorDetails: true,
|
|
36
|
-
errorStack: true,
|
|
37
|
-
publicPath: true,
|
|
38
|
-
logging: "verbose",
|
|
39
|
-
orphanModules: true,
|
|
40
|
-
runtimeModules: true,
|
|
41
|
-
// exclude: false,
|
|
42
|
-
excludeModules: false,
|
|
43
|
-
errorsSpace: Number.POSITIVE_INFINITY,
|
|
44
|
-
warningsSpace: Number.POSITIVE_INFINITY,
|
|
45
|
-
modulesSpace: Number.POSITIVE_INFINITY,
|
|
46
|
-
chunkModulesSpace: Number.POSITIVE_INFINITY,
|
|
47
|
-
assetsSpace: Number.POSITIVE_INFINITY,
|
|
48
|
-
reasonsSpace: Number.POSITIVE_INFINITY,
|
|
49
|
-
children: true
|
|
50
|
-
},
|
|
51
|
-
detailed: {
|
|
52
|
-
hash: true,
|
|
53
|
-
builtAt: true,
|
|
54
|
-
relatedAssets: true,
|
|
55
|
-
entrypoints: true,
|
|
56
|
-
chunkGroups: true,
|
|
57
|
-
ids: true,
|
|
58
|
-
chunks: true,
|
|
59
|
-
chunkRelations: true,
|
|
60
|
-
chunkModules: false,
|
|
61
|
-
chunkOrigins: true,
|
|
62
|
-
depth: true,
|
|
63
|
-
usedExports: true,
|
|
64
|
-
providedExports: true,
|
|
65
|
-
optimizationBailout: true,
|
|
66
|
-
errorDetails: true,
|
|
67
|
-
publicPath: true,
|
|
68
|
-
logging: true,
|
|
69
|
-
runtimeModules: true,
|
|
70
|
-
excludeModules: false,
|
|
71
|
-
errorsSpace: 1000,
|
|
72
|
-
warningsSpace: 1000,
|
|
73
|
-
modulesSpace: 1000,
|
|
74
|
-
assetsSpace: 1000,
|
|
75
|
-
reasonsSpace: 1000
|
|
76
|
-
},
|
|
77
|
-
minimal: {
|
|
78
|
-
all: false,
|
|
79
|
-
version: true,
|
|
80
|
-
timings: true,
|
|
81
|
-
modules: true,
|
|
82
|
-
errorsSpace: 0,
|
|
83
|
-
warningsSpace: 0,
|
|
84
|
-
modulesSpace: 0,
|
|
85
|
-
assets: true,
|
|
86
|
-
assetsSpace: 0,
|
|
87
|
-
errors: true,
|
|
88
|
-
errorsCount: true,
|
|
89
|
-
warnings: true,
|
|
90
|
-
warningsCount: true,
|
|
91
|
-
logging: "warn"
|
|
92
|
-
},
|
|
93
|
-
"errors-only": {
|
|
94
|
-
all: false,
|
|
95
|
-
errors: true,
|
|
96
|
-
errorsCount: true,
|
|
97
|
-
errorsSpace: Number.POSITIVE_INFINITY,
|
|
98
|
-
moduleTrace: true,
|
|
99
|
-
logging: "error"
|
|
100
|
-
},
|
|
101
|
-
"errors-warnings": {
|
|
102
|
-
all: false,
|
|
103
|
-
errors: true,
|
|
104
|
-
errorsCount: true,
|
|
105
|
-
errorsSpace: Number.POSITIVE_INFINITY,
|
|
106
|
-
warnings: true,
|
|
107
|
-
warningsCount: true,
|
|
108
|
-
warningsSpace: Number.POSITIVE_INFINITY,
|
|
109
|
-
logging: "warn"
|
|
110
|
-
},
|
|
111
|
-
summary: {
|
|
112
|
-
all: false,
|
|
113
|
-
version: true,
|
|
114
|
-
errorsCount: true,
|
|
115
|
-
warningsCount: true
|
|
116
|
-
},
|
|
117
|
-
none: {
|
|
118
|
-
all: false
|
|
119
|
-
}
|
|
120
|
-
};
|
|
121
|
-
const NORMAL_ON = ({ all }) => all !== false;
|
|
122
|
-
const NORMAL_OFF = ({ all }) => all === true;
|
|
123
|
-
const ON_FOR_TO_STRING = ({ all }, { forToString }) => forToString ? all !== false : all === true;
|
|
124
|
-
const OFF_FOR_TO_STRING = ({ all }, { forToString }) => forToString ? all === true : all !== false;
|
|
125
|
-
const AUTO_FOR_TO_STRING = ({ all }, { forToString }) => {
|
|
126
|
-
if (all === false)
|
|
127
|
-
return false;
|
|
128
|
-
if (all === true)
|
|
129
|
-
return true;
|
|
130
|
-
if (forToString)
|
|
131
|
-
return "auto";
|
|
132
|
-
return true;
|
|
133
|
-
};
|
|
134
|
-
const DEFAULTS = {
|
|
135
|
-
// context: (options, context, compilation) => compilation.compiler.context,
|
|
136
|
-
// requestShortener: (options, context, compilation) =>
|
|
137
|
-
// compilation.compiler.context === options.context
|
|
138
|
-
// ? compilation.requestShortener
|
|
139
|
-
// : new RequestShortener(options.context, compilation.compiler.root),
|
|
140
|
-
performance: NORMAL_ON,
|
|
141
|
-
hash: OFF_FOR_TO_STRING,
|
|
142
|
-
env: NORMAL_OFF,
|
|
143
|
-
version: NORMAL_ON,
|
|
144
|
-
timings: NORMAL_ON,
|
|
145
|
-
builtAt: OFF_FOR_TO_STRING,
|
|
146
|
-
assets: NORMAL_ON,
|
|
147
|
-
entrypoints: AUTO_FOR_TO_STRING,
|
|
148
|
-
chunkGroups: OFF_FOR_TO_STRING,
|
|
149
|
-
chunkGroupAuxiliary: OFF_FOR_TO_STRING,
|
|
150
|
-
chunkGroupChildren: OFF_FOR_TO_STRING,
|
|
151
|
-
chunkGroupMaxAssets: (o, { forToString }) => forToString ? 5 : Number.POSITIVE_INFINITY,
|
|
152
|
-
chunks: OFF_FOR_TO_STRING,
|
|
153
|
-
chunkRelations: OFF_FOR_TO_STRING,
|
|
154
|
-
chunkModules: ({ all, modules }) => {
|
|
155
|
-
if (all === false)
|
|
156
|
-
return false;
|
|
157
|
-
if (all === true)
|
|
158
|
-
return true;
|
|
159
|
-
if (modules)
|
|
160
|
-
return false;
|
|
161
|
-
return true;
|
|
162
|
-
},
|
|
163
|
-
dependentModules: OFF_FOR_TO_STRING,
|
|
164
|
-
chunkOrigins: OFF_FOR_TO_STRING,
|
|
165
|
-
ids: OFF_FOR_TO_STRING,
|
|
166
|
-
modules: ({ all, chunks, chunkModules }, { forToString }) => {
|
|
167
|
-
if (all === false)
|
|
168
|
-
return false;
|
|
169
|
-
if (all === true)
|
|
170
|
-
return true;
|
|
171
|
-
if (forToString && chunks && chunkModules)
|
|
172
|
-
return false;
|
|
173
|
-
return true;
|
|
174
|
-
},
|
|
175
|
-
nestedModules: OFF_FOR_TO_STRING,
|
|
176
|
-
groupModulesByType: ON_FOR_TO_STRING,
|
|
177
|
-
groupModulesByCacheStatus: ON_FOR_TO_STRING,
|
|
178
|
-
groupModulesByLayer: ON_FOR_TO_STRING,
|
|
179
|
-
groupModulesByAttributes: ON_FOR_TO_STRING,
|
|
180
|
-
groupModulesByPath: ON_FOR_TO_STRING,
|
|
181
|
-
groupModulesByExtension: ON_FOR_TO_STRING,
|
|
182
|
-
modulesSpace: (o, { forToString }) => forToString ? 15 : Number.POSITIVE_INFINITY,
|
|
183
|
-
chunkModulesSpace: (o, { forToString }) => forToString ? 10 : Number.POSITIVE_INFINITY,
|
|
184
|
-
nestedModulesSpace: (o, { forToString }) => forToString ? 10 : Number.POSITIVE_INFINITY,
|
|
185
|
-
relatedAssets: OFF_FOR_TO_STRING,
|
|
186
|
-
groupAssetsByEmitStatus: ON_FOR_TO_STRING,
|
|
187
|
-
groupAssetsByInfo: ON_FOR_TO_STRING,
|
|
188
|
-
groupAssetsByPath: ON_FOR_TO_STRING,
|
|
189
|
-
groupAssetsByExtension: ON_FOR_TO_STRING,
|
|
190
|
-
groupAssetsByChunk: ON_FOR_TO_STRING,
|
|
191
|
-
assetsSpace: (o, { forToString }) => forToString ? 15 : Number.POSITIVE_INFINITY,
|
|
192
|
-
orphanModules: OFF_FOR_TO_STRING,
|
|
193
|
-
runtimeModules: ({ all, runtime }, { forToString }) => runtime !== undefined
|
|
194
|
-
? runtime
|
|
195
|
-
: forToString
|
|
196
|
-
? all === true
|
|
197
|
-
: all !== false,
|
|
198
|
-
cachedModules: ({ all, cached }, { forToString }) => cached !== undefined ? cached : forToString ? all === true : all !== false,
|
|
199
|
-
moduleAssets: OFF_FOR_TO_STRING,
|
|
200
|
-
depth: OFF_FOR_TO_STRING,
|
|
201
|
-
cachedAssets: OFF_FOR_TO_STRING,
|
|
202
|
-
reasons: OFF_FOR_TO_STRING,
|
|
203
|
-
reasonsSpace: (o, { forToString }) => forToString ? 15 : Number.POSITIVE_INFINITY,
|
|
204
|
-
groupReasonsByOrigin: ON_FOR_TO_STRING,
|
|
205
|
-
usedExports: OFF_FOR_TO_STRING,
|
|
206
|
-
providedExports: OFF_FOR_TO_STRING,
|
|
207
|
-
optimizationBailout: OFF_FOR_TO_STRING,
|
|
208
|
-
children: OFF_FOR_TO_STRING,
|
|
209
|
-
source: NORMAL_OFF,
|
|
210
|
-
moduleTrace: NORMAL_ON,
|
|
211
|
-
errors: NORMAL_ON,
|
|
212
|
-
errorsCount: NORMAL_ON,
|
|
213
|
-
errorDetails: AUTO_FOR_TO_STRING,
|
|
214
|
-
errorStack: OFF_FOR_TO_STRING,
|
|
215
|
-
warnings: NORMAL_ON,
|
|
216
|
-
warningsCount: NORMAL_ON,
|
|
217
|
-
publicPath: OFF_FOR_TO_STRING,
|
|
218
|
-
logging: ({ all }, { forToString }) => forToString && all !== false ? "info" : false,
|
|
219
|
-
loggingDebug: () => [],
|
|
220
|
-
loggingTrace: OFF_FOR_TO_STRING,
|
|
221
|
-
excludeModules: () => [],
|
|
222
|
-
excludeAssets: () => [],
|
|
223
|
-
modulesSort: () => "depth",
|
|
224
|
-
chunkModulesSort: () => "name",
|
|
225
|
-
nestedModulesSort: () => false,
|
|
226
|
-
chunksSort: () => false,
|
|
227
|
-
assetsSort: () => "!size",
|
|
228
|
-
outputPath: OFF_FOR_TO_STRING,
|
|
229
|
-
colors: () => false
|
|
230
|
-
};
|
|
231
|
-
const normalizeFilter = item => {
|
|
232
|
-
if (typeof item === "string") {
|
|
233
|
-
const regExp = new RegExp(`[\\\\/]${item.replace(/[-[\]{}()*+?.\\^$|]/g, "\\$&")}([\\\\/]|$|!|\\?)`);
|
|
234
|
-
return ident => regExp.test(ident);
|
|
235
|
-
}
|
|
236
|
-
if (item &&
|
|
237
|
-
typeof item === "object" &&
|
|
238
|
-
"test" in item &&
|
|
239
|
-
typeof item.test === "function") {
|
|
240
|
-
const test = item.test.bind(item);
|
|
241
|
-
return ident => test(ident);
|
|
242
|
-
}
|
|
243
|
-
if (typeof item === "function") {
|
|
244
|
-
return item;
|
|
245
|
-
}
|
|
246
|
-
if (typeof item === "boolean") {
|
|
247
|
-
return () => item;
|
|
248
|
-
}
|
|
249
|
-
};
|
|
250
|
-
const NORMALIZER = {
|
|
251
|
-
excludeModules: (value) => {
|
|
252
|
-
const array = !Array.isArray(value) ? (value ? [value] : []) : value;
|
|
253
|
-
return array.map(normalizeFilter);
|
|
254
|
-
},
|
|
255
|
-
excludeAssets: (value) => {
|
|
256
|
-
const array = !Array.isArray(value) ? (value ? [value] : []) : value;
|
|
257
|
-
return array.map(normalizeFilter);
|
|
258
|
-
},
|
|
259
|
-
warningsFilter: (value) => {
|
|
260
|
-
const array = !Array.isArray(value) ? (value ? [value] : []) : value;
|
|
261
|
-
return array.map(filter => {
|
|
262
|
-
if (typeof filter === "string") {
|
|
263
|
-
return (warning, warningString) => warningString.includes(filter);
|
|
264
|
-
}
|
|
265
|
-
if (filter instanceof RegExp) {
|
|
266
|
-
return (warning, warningString) => filter.test(warningString);
|
|
267
|
-
}
|
|
268
|
-
if (typeof filter === "function") {
|
|
269
|
-
return filter;
|
|
270
|
-
}
|
|
271
|
-
throw new Error(`Can only filter warnings with Strings or RegExps. (Given: ${filter})`);
|
|
272
|
-
});
|
|
273
|
-
},
|
|
274
|
-
logging: (value) => {
|
|
275
|
-
return value === true ? "log" : value;
|
|
276
|
-
},
|
|
277
|
-
loggingDebug: (value) => {
|
|
278
|
-
const array = !Array.isArray(value) ? (value ? [value] : []) : value;
|
|
279
|
-
return array.map(normalizeFilter);
|
|
280
|
-
}
|
|
281
|
-
};
|
|
282
|
-
class DefaultStatsPresetPlugin {
|
|
283
|
-
apply(compiler) {
|
|
284
|
-
compiler.hooks.compilation.tap("DefaultStatsPresetPlugin", compilation => {
|
|
285
|
-
for (const key of Object.keys(NAMED_PRESETS)) {
|
|
286
|
-
const defaults = NAMED_PRESETS[key];
|
|
287
|
-
compilation.hooks.statsPreset
|
|
288
|
-
.for(key)
|
|
289
|
-
.tap("DefaultStatsPresetPlugin", (options, context) => {
|
|
290
|
-
applyDefaults(options, defaults);
|
|
291
|
-
});
|
|
292
|
-
}
|
|
293
|
-
compilation.hooks.statsNormalize.tap("DefaultStatsPresetPlugin", (options, context) => {
|
|
294
|
-
for (const key of Object.keys(DEFAULTS)) {
|
|
295
|
-
if (options[key] === undefined)
|
|
296
|
-
options[key] = DEFAULTS[key](options, context, compilation);
|
|
297
|
-
}
|
|
298
|
-
for (const key of Object.keys(NORMALIZER)) {
|
|
299
|
-
options[key] = NORMALIZER[key](options[key]);
|
|
300
|
-
}
|
|
301
|
-
});
|
|
302
|
-
});
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
exports.DefaultStatsPresetPlugin = DefaultStatsPresetPlugin;
|