@rspack/core 0.7.6-canary-1a0d77d-20240627143904 → 1.0.0-alpha.1
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 +2 -2
- package/compiled/enhanced-resolve/index.js +11 -11
- package/compiled/webpack-sources/index.d.ts +130 -0
- package/compiled/webpack-sources/index.js +3520 -0
- package/compiled/webpack-sources/license +21 -0
- package/compiled/webpack-sources/package.json +1 -0
- package/dist/Chunk.d.ts +19 -14
- package/dist/Chunk.js +22 -17
- package/dist/ChunkGraph.d.ts +1 -1
- package/dist/ChunkGraph.js +5 -5
- package/dist/ChunkGroup.d.ts +17 -7
- package/dist/ChunkGroup.js +12 -2
- package/dist/Compilation.d.ts +31 -33
- package/dist/Compilation.js +33 -53
- package/dist/Compiler.d.ts +26 -28
- package/dist/Compiler.js +74 -26
- package/dist/ContextModuleFactory.d.ts +1 -1
- package/dist/ContextModuleFactory.js +1 -1
- package/dist/Entrypoint.d.ts +1 -1
- package/dist/Entrypoint.js +2 -2
- package/dist/Module.d.ts +12 -7
- package/dist/Module.js +1 -0
- package/dist/MultiCompiler.d.ts +11 -11
- package/dist/MultiCompiler.js +30 -13
- package/dist/NormalModule.d.ts +7 -4
- package/dist/NormalModule.js +27 -11
- package/dist/NormalModuleFactory.d.ts +3 -1
- package/dist/NormalModuleFactory.js +3 -23
- package/dist/ResolverFactory.d.ts +3 -3
- package/dist/ResolverFactory.js +1 -1
- package/dist/RspackError.d.ts +8 -0
- package/dist/RspackError.js +21 -0
- package/dist/Stats.d.ts +4 -2
- package/dist/Stats.js +6 -0
- package/dist/Template.d.ts +1 -1
- package/dist/Template.js +2 -2
- package/dist/Watching.d.ts +1 -1
- package/dist/builtin-loader/swc/index.d.ts +0 -4
- package/dist/builtin-loader/swc/index.js +1 -5
- package/dist/builtin-loader/swc/preact.d.ts +3 -4
- package/dist/builtin-loader/swc/types.d.ts +2 -17
- package/dist/builtin-plugin/BundlerInfoRspackPlugin.d.ts +1 -0
- package/dist/builtin-plugin/BundlerInfoRspackPlugin.js +1 -0
- package/dist/builtin-plugin/JavascriptModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/JavascriptModulesPlugin.js +1 -1
- package/dist/builtin-plugin/LightningCssMiminizerRspackPlugin.js +1 -1
- package/dist/builtin-plugin/SplitChunksPlugin.js +11 -2
- package/dist/builtin-plugin/SwcJsMinimizerPlugin.d.ts +0 -28
- package/dist/builtin-plugin/SwcJsMinimizerPlugin.js +20 -69
- package/dist/builtin-plugin/css-extract/index.d.ts +2 -2
- package/dist/config/adapter.js +30 -16
- package/dist/config/adapterRuleUse.js +0 -11
- package/dist/config/defaults.js +22 -30
- package/dist/config/normalization.js +13 -5
- package/dist/config/zod.d.ts +753 -205
- package/dist/config/zod.js +27 -13
- package/dist/container/ModuleFederationPlugin.js +1 -1
- package/dist/container/default.runtime.js +1 -170
- package/dist/exports.d.ts +9 -2
- package/dist/exports.js +11 -6
- package/dist/lib/Cache.d.ts +3 -3
- package/dist/lib/Cache.js +1 -1
- package/dist/loader-runner/index.js +37 -12
- package/dist/rspack.d.ts +1 -1
- package/dist/rspackOptionsApply.js +3 -0
- package/dist/stats/DefaultStatsFactoryPlugin.js +35 -11
- package/dist/stats/DefaultStatsPrinterPlugin.js +2 -2
- package/dist/stats/StatsFactory.d.ts +2 -2
- package/dist/stats/StatsFactory.js +12 -12
- package/dist/stats/StatsPrinter.d.ts +1 -1
- package/dist/stats/StatsPrinter.js +8 -8
- package/dist/stats/statsFactoryUtils.d.ts +13 -4
- package/dist/util/SplitChunkSize.d.ts +5 -0
- package/dist/util/SplitChunkSize.js +18 -0
- package/dist/util/index.d.ts +2 -2
- package/dist/util/index.js +4 -3
- package/dist/util/memoize.js +5 -1
- package/dist/util/source.d.ts +1 -1
- package/dist/util/source.js +1 -1
- package/package.json +14 -9
- package/dist/builtin-loader/swc/emotion.d.ts +0 -17
- package/dist/builtin-loader/swc/emotion.js +0 -22
- package/dist/builtin-loader/swc/relay.d.ts +0 -5
- package/dist/builtin-loader/swc/relay.js +0 -48
- package/dist/container/default.runtime.d.ts +0 -2
- package/dist/lite-tapable/index.d.ts +0 -146
- package/dist/lite-tapable/index.js +0 -752
package/dist/config/zod.js
CHANGED
|
@@ -113,7 +113,7 @@ const entryDescription = zod_1.z.strictObject({
|
|
|
113
113
|
const entryUnnamed = entryItem;
|
|
114
114
|
const entryObject = zod_1.z.record(entryItem.or(entryDescription));
|
|
115
115
|
const entryStatic = entryObject.or(entryUnnamed);
|
|
116
|
-
const entry = entryStatic.or(zod_1.z.function().returns(entryStatic));
|
|
116
|
+
const entry = entryStatic.or(zod_1.z.function().returns(entryStatic.or(zod_1.z.promise(entryStatic))));
|
|
117
117
|
//#endregion
|
|
118
118
|
//#region Output
|
|
119
119
|
const path = zod_1.z.string();
|
|
@@ -194,7 +194,6 @@ const output = zod_1.z.strictObject({
|
|
|
194
194
|
libraryExport: libraryExport.optional(),
|
|
195
195
|
libraryTarget: libraryType.optional(),
|
|
196
196
|
umdNamedDefine: umdNamedDefine.optional(),
|
|
197
|
-
amdContainer: amdContainer.optional(),
|
|
198
197
|
auxiliaryComment: auxiliaryComment.optional(),
|
|
199
198
|
module: outputModule.optional(),
|
|
200
199
|
strictModuleExceptionHandling: strictModuleExceptionHandling.optional(),
|
|
@@ -230,10 +229,11 @@ const resolveAlias = zod_1.z.record(zod_1.z
|
|
|
230
229
|
.literal(false)
|
|
231
230
|
.or(zod_1.z.string())
|
|
232
231
|
.or(zod_1.z.array(zod_1.z.string().or(zod_1.z.literal(false)))));
|
|
233
|
-
const
|
|
234
|
-
|
|
232
|
+
const resolveTsConfigFile = zod_1.z.string();
|
|
233
|
+
const resolveTsConfig = resolveTsConfigFile.or(zod_1.z.strictObject({
|
|
234
|
+
configFile: resolveTsConfigFile,
|
|
235
235
|
references: zod_1.z.array(zod_1.z.string()).or(zod_1.z.literal("auto")).optional()
|
|
236
|
-
});
|
|
236
|
+
}));
|
|
237
237
|
const baseResolveOptions = zod_1.z.strictObject({
|
|
238
238
|
alias: resolveAlias.optional(),
|
|
239
239
|
conditionNames: zod_1.z.array(zod_1.z.string()).optional(),
|
|
@@ -248,8 +248,7 @@ const baseResolveOptions = zod_1.z.strictObject({
|
|
|
248
248
|
enforceExtension: zod_1.z.boolean().optional(),
|
|
249
249
|
importsFields: zod_1.z.array(zod_1.z.string()).optional(),
|
|
250
250
|
descriptionFiles: zod_1.z.array(zod_1.z.string()).optional(),
|
|
251
|
-
|
|
252
|
-
tsConfig: resolveTsconfig.optional(),
|
|
251
|
+
tsConfig: resolveTsConfig.optional(),
|
|
253
252
|
fullySpecified: zod_1.z.boolean().optional(),
|
|
254
253
|
exportsFields: zod_1.z.array(zod_1.z.string()).optional(),
|
|
255
254
|
extensionAlias: zod_1.z.record(zod_1.z.string().or(zod_1.z.array(zod_1.z.string()))).optional(),
|
|
@@ -334,6 +333,7 @@ const cssModuleParserOptions = zod_1.z.strictObject({
|
|
|
334
333
|
const dynamicImportMode = zod_1.z.enum(["eager", "lazy", "weak", "lazy-once"]);
|
|
335
334
|
const dynamicImportPreload = zod_1.z.union([zod_1.z.boolean(), zod_1.z.number()]);
|
|
336
335
|
const dynamicImportPrefetch = zod_1.z.union([zod_1.z.boolean(), zod_1.z.number()]);
|
|
336
|
+
const dynamicImportFetchPriority = zod_1.z.enum(["low", "high", "auto"]);
|
|
337
337
|
const javascriptParserUrl = zod_1.z.union([zod_1.z.literal("relative"), zod_1.z.boolean()]);
|
|
338
338
|
const exprContextCritical = zod_1.z.boolean();
|
|
339
339
|
const wrappedContextCritical = zod_1.z.boolean();
|
|
@@ -345,17 +345,20 @@ const reexportExportsPresence = zod_1.z
|
|
|
345
345
|
.enum(["error", "warn", "auto"])
|
|
346
346
|
.or(zod_1.z.literal(false));
|
|
347
347
|
const strictExportPresence = zod_1.z.boolean();
|
|
348
|
+
const worker = zod_1.z.array(zod_1.z.string()).or(zod_1.z.boolean());
|
|
348
349
|
const javascriptParserOptions = zod_1.z.strictObject({
|
|
349
350
|
dynamicImportMode: dynamicImportMode.optional(),
|
|
350
351
|
dynamicImportPreload: dynamicImportPreload.optional(),
|
|
351
352
|
dynamicImportPrefetch: dynamicImportPrefetch.optional(),
|
|
353
|
+
dynamicImportFetchPriority: dynamicImportFetchPriority.optional(),
|
|
352
354
|
url: javascriptParserUrl.optional(),
|
|
353
355
|
exprContextCritical: exprContextCritical.optional(),
|
|
354
356
|
wrappedContextCritical: wrappedContextCritical.optional(),
|
|
355
357
|
exportsPresence: exportsPresence.optional(),
|
|
356
358
|
importExportsPresence: importExportsPresence.optional(),
|
|
357
359
|
reexportExportsPresence: reexportExportsPresence.optional(),
|
|
358
|
-
strictExportPresence: strictExportPresence.optional()
|
|
360
|
+
strictExportPresence: strictExportPresence.optional(),
|
|
361
|
+
worker: worker.optional()
|
|
359
362
|
});
|
|
360
363
|
const parserOptionsByModuleTypeKnown = zod_1.z.strictObject({
|
|
361
364
|
asset: assetParserOptions.optional(),
|
|
@@ -470,7 +473,13 @@ const allowTarget = zod_1.z
|
|
|
470
473
|
.or(zod_1.z.custom(value => typeof value === "string" && /^electron\d+\.\d+-renderer$/.test(value)))
|
|
471
474
|
.or(zod_1.z.literal("electron-preload"))
|
|
472
475
|
.or(zod_1.z.custom(value => typeof value === "string" && /^electron\d+-preload$/.test(value)))
|
|
473
|
-
.or(zod_1.z.custom(value => typeof value === "string" && /^electron\d+\.\d+-preload$/.test(value)))
|
|
476
|
+
.or(zod_1.z.custom(value => typeof value === "string" && /^electron\d+\.\d+-preload$/.test(value)))
|
|
477
|
+
.or(zod_1.z.literal("nwjs"))
|
|
478
|
+
.or(zod_1.z.custom(value => typeof value === "string" && /^nwjs\d+$/.test(value)))
|
|
479
|
+
.or(zod_1.z.custom(value => typeof value === "string" && /^nwjs\d+\.\d+$/.test(value)))
|
|
480
|
+
.or(zod_1.z.literal("node-webkit"))
|
|
481
|
+
.or(zod_1.z.custom(value => typeof value === "string" && /^node-webkit\d+$/.test(value)))
|
|
482
|
+
.or(zod_1.z.custom(value => typeof value === "string" && /^node-webkit\d+\.\d+$/.test(value)));
|
|
474
483
|
const target = zod_1.z.literal(false).or(allowTarget).or(allowTarget.array());
|
|
475
484
|
//#endregion
|
|
476
485
|
//#region ExternalsType
|
|
@@ -534,7 +543,8 @@ const externalsPresets = zod_1.z.strictObject({
|
|
|
534
543
|
electron: zod_1.z.boolean().optional(),
|
|
535
544
|
electronMain: zod_1.z.boolean().optional(),
|
|
536
545
|
electronPreload: zod_1.z.boolean().optional(),
|
|
537
|
-
electronRenderer: zod_1.z.boolean().optional()
|
|
546
|
+
electronRenderer: zod_1.z.boolean().optional(),
|
|
547
|
+
nwjs: zod_1.z.boolean().optional()
|
|
538
548
|
});
|
|
539
549
|
//#endregion
|
|
540
550
|
//#region InfrastructureLogging
|
|
@@ -736,8 +746,11 @@ const optimizationSplitChunksName = zod_1.z
|
|
|
736
746
|
const optimizationSplitChunksChunks = zod_1.z
|
|
737
747
|
.enum(["initial", "async", "all"])
|
|
738
748
|
.or(zod_1.z.instanceof(RegExp))
|
|
739
|
-
.or(zod_1.z
|
|
740
|
-
|
|
749
|
+
.or(zod_1.z
|
|
750
|
+
.function()
|
|
751
|
+
.args(zod_1.z.instanceof(Chunk_1.Chunk, { message: "Input not instance of Chunk" }))
|
|
752
|
+
.returns(zod_1.z.boolean()));
|
|
753
|
+
const optimizationSplitChunksSizes = zod_1.z.number().or(zod_1.z.record(zod_1.z.number()));
|
|
741
754
|
const optimizationSplitChunksDefaultSizeTypes = zod_1.z.array(zod_1.z.string());
|
|
742
755
|
const sharedOptimizationSplitChunksCacheGroup = {
|
|
743
756
|
chunks: optimizationSplitChunksChunks.optional(),
|
|
@@ -810,9 +823,10 @@ const rspackFutureOptions = zod_1.z.strictObject({
|
|
|
810
823
|
bundlerInfo: zod_1.z
|
|
811
824
|
.strictObject({
|
|
812
825
|
version: zod_1.z.string().optional(),
|
|
826
|
+
bundler: zod_1.z.string().optional(),
|
|
813
827
|
force: zod_1.z
|
|
814
828
|
.boolean()
|
|
815
|
-
.or(zod_1.z.array(zod_1.z.enum(["version"])))
|
|
829
|
+
.or(zod_1.z.array(zod_1.z.enum(["version", "uniqueId"])))
|
|
816
830
|
.optional()
|
|
817
831
|
})
|
|
818
832
|
.optional()
|
|
@@ -131,6 +131,6 @@ function getDefaultEntryRuntime(paths, options, compiler) {
|
|
|
131
131
|
`const __module_federation_remote_infos__ = ${JSON.stringify(remoteInfos)}`,
|
|
132
132
|
`const __module_federation_container_name__ = ${JSON.stringify(options.name ?? compiler.options.output.uniqueName)}`,
|
|
133
133
|
compiler.webpack.Template.getFunctionContent(require("./default.runtime"))
|
|
134
|
-
].join("
|
|
134
|
+
].join(";");
|
|
135
135
|
return `@module-federation/runtime/rspack.js!=!data:text/javascript,${content}`;
|
|
136
136
|
}
|
|
@@ -1,170 +1 @@
|
|
|
1
|
-
"
|
|
2
|
-
// @ts-nocheck
|
|
3
|
-
var __module_federation_bundler_runtime__, __module_federation_runtime_plugins__, __module_federation_remote_infos__, __module_federation_container_name__;
|
|
4
|
-
module.exports = function () {
|
|
5
|
-
if ((__webpack_require__.initializeSharingData ||
|
|
6
|
-
__webpack_require__.initializeExposesData) &&
|
|
7
|
-
__webpack_require__.federation) {
|
|
8
|
-
const override = (obj, key, value) => {
|
|
9
|
-
if (!obj)
|
|
10
|
-
return;
|
|
11
|
-
if (obj[key])
|
|
12
|
-
obj[key] = value;
|
|
13
|
-
};
|
|
14
|
-
const merge = (obj, key, fn) => {
|
|
15
|
-
const value = fn();
|
|
16
|
-
if (Array.isArray(value)) {
|
|
17
|
-
obj[key] ??= [];
|
|
18
|
-
obj[key].push(...value);
|
|
19
|
-
}
|
|
20
|
-
else if (typeof value === "object" && value !== null) {
|
|
21
|
-
obj[key] ??= {};
|
|
22
|
-
Object.assign(obj[key], value);
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
const early = (obj, key, initial) => {
|
|
26
|
-
obj[key] ??= initial();
|
|
27
|
-
};
|
|
28
|
-
const remotesLoadingChunkMapping = __webpack_require__.remotesLoadingData?.chunkMapping ?? {};
|
|
29
|
-
const remotesLoadingModuleIdToRemoteDataMapping = __webpack_require__.remotesLoadingData?.moduleIdToRemoteDataMapping ?? {};
|
|
30
|
-
const initializeSharingScopeToInitDataMapping = __webpack_require__.initializeSharingData?.scopeToSharingDataMapping ??
|
|
31
|
-
{};
|
|
32
|
-
const consumesLoadingChunkMapping = __webpack_require__.consumesLoadingData?.chunkMapping ?? {};
|
|
33
|
-
const consumesLoadingModuleToConsumeDataMapping = __webpack_require__.consumesLoadingData?.moduleIdToConsumeDataMapping ??
|
|
34
|
-
{};
|
|
35
|
-
const consumesLoadinginstalledModules = {};
|
|
36
|
-
const initializeSharingInitPromises = [];
|
|
37
|
-
const initializeSharingInitTokens = [];
|
|
38
|
-
const containerShareScope = __webpack_require__.initializeExposesData?.shareScope;
|
|
39
|
-
for (const key in __module_federation_bundler_runtime__) {
|
|
40
|
-
__webpack_require__.federation[key] =
|
|
41
|
-
__module_federation_bundler_runtime__[key];
|
|
42
|
-
}
|
|
43
|
-
early(__webpack_require__.federation, "consumesLoadingModuleToHandlerMapping", () => {
|
|
44
|
-
const consumesLoadingModuleToHandlerMapping = {};
|
|
45
|
-
for (let [moduleId, data] of Object.entries(consumesLoadingModuleToConsumeDataMapping)) {
|
|
46
|
-
consumesLoadingModuleToHandlerMapping[moduleId] = {
|
|
47
|
-
getter: data.fallback,
|
|
48
|
-
shareInfo: {
|
|
49
|
-
shareConfig: {
|
|
50
|
-
fixedDependencies: false,
|
|
51
|
-
requiredVersion: data.requiredVersion,
|
|
52
|
-
strictVersion: data.strictVersion,
|
|
53
|
-
singleton: data.singleton,
|
|
54
|
-
eager: data.eager
|
|
55
|
-
},
|
|
56
|
-
scope: [data.shareScope]
|
|
57
|
-
},
|
|
58
|
-
shareKey: data.shareKey
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
return consumesLoadingModuleToHandlerMapping;
|
|
62
|
-
});
|
|
63
|
-
early(__webpack_require__.federation, "initOptions", () => ({}));
|
|
64
|
-
early(__webpack_require__.federation.initOptions, "name", () => __module_federation_container_name__);
|
|
65
|
-
early(__webpack_require__.federation.initOptions, "shared", () => {
|
|
66
|
-
const shared = {};
|
|
67
|
-
for (let [scope, stages] of Object.entries(initializeSharingScopeToInitDataMapping)) {
|
|
68
|
-
for (let stage of stages) {
|
|
69
|
-
if (typeof stage === "object" && stage !== null) {
|
|
70
|
-
const { name, version, factory, eager } = stage;
|
|
71
|
-
const options = { version, scope: [scope], get: factory };
|
|
72
|
-
if (shared[name]) {
|
|
73
|
-
shared[name].push(options);
|
|
74
|
-
}
|
|
75
|
-
else {
|
|
76
|
-
shared[name] = [options];
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
return shared;
|
|
82
|
-
});
|
|
83
|
-
merge(__webpack_require__.federation.initOptions, "remotes", () => Object.values(__module_federation_remote_infos__)
|
|
84
|
-
.flat()
|
|
85
|
-
.filter(remote => remote.externalType === "script"));
|
|
86
|
-
merge(__webpack_require__.federation.initOptions, "plugins", () => __module_federation_runtime_plugins__);
|
|
87
|
-
early(__webpack_require__.federation, "bundlerRuntimeOptions", () => ({}));
|
|
88
|
-
early(__webpack_require__.federation.bundlerRuntimeOptions, "remotes", () => ({}));
|
|
89
|
-
early(__webpack_require__.federation.bundlerRuntimeOptions.remotes, "chunkMapping", () => remotesLoadingChunkMapping);
|
|
90
|
-
early(__webpack_require__.federation.bundlerRuntimeOptions.remotes, "idToExternalAndNameMapping", () => {
|
|
91
|
-
const remotesLoadingIdToExternalAndNameMappingMapping = {};
|
|
92
|
-
for (let [moduleId, data] of Object.entries(remotesLoadingModuleIdToRemoteDataMapping)) {
|
|
93
|
-
remotesLoadingIdToExternalAndNameMappingMapping[moduleId] = [
|
|
94
|
-
data.shareScope,
|
|
95
|
-
data.name,
|
|
96
|
-
data.externalModuleId,
|
|
97
|
-
data.remoteName
|
|
98
|
-
];
|
|
99
|
-
}
|
|
100
|
-
return remotesLoadingIdToExternalAndNameMappingMapping;
|
|
101
|
-
});
|
|
102
|
-
early(__webpack_require__.federation.bundlerRuntimeOptions.remotes, "webpackRequire", () => __webpack_require__);
|
|
103
|
-
merge(__webpack_require__.federation.bundlerRuntimeOptions.remotes, "idToRemoteMap", () => {
|
|
104
|
-
const idToRemoteMap = {};
|
|
105
|
-
for (let [id, remoteData] of Object.entries(remotesLoadingModuleIdToRemoteDataMapping)) {
|
|
106
|
-
const info = __module_federation_remote_infos__[remoteData.remoteName];
|
|
107
|
-
if (info)
|
|
108
|
-
idToRemoteMap[id] = info;
|
|
109
|
-
}
|
|
110
|
-
return idToRemoteMap;
|
|
111
|
-
});
|
|
112
|
-
override(__webpack_require__, "S", __webpack_require__.federation.bundlerRuntime.S);
|
|
113
|
-
if (__webpack_require__.federation.attachShareScopeMap) {
|
|
114
|
-
__webpack_require__.federation.attachShareScopeMap(__webpack_require__);
|
|
115
|
-
}
|
|
116
|
-
override(__webpack_require__.f, "remotes", (chunkId, promises) => __webpack_require__.federation.bundlerRuntime.remotes({
|
|
117
|
-
chunkId,
|
|
118
|
-
promises,
|
|
119
|
-
chunkMapping: remotesLoadingChunkMapping,
|
|
120
|
-
idToExternalAndNameMapping: __webpack_require__.federation.bundlerRuntimeOptions.remotes
|
|
121
|
-
.idToExternalAndNameMapping,
|
|
122
|
-
idToRemoteMap: __webpack_require__.federation.bundlerRuntimeOptions.remotes
|
|
123
|
-
.idToRemoteMap,
|
|
124
|
-
webpackRequire: __webpack_require__
|
|
125
|
-
}));
|
|
126
|
-
override(__webpack_require__.f, "consumes", (chunkId, promises) => __webpack_require__.federation.bundlerRuntime.consumes({
|
|
127
|
-
chunkId,
|
|
128
|
-
promises,
|
|
129
|
-
chunkMapping: consumesLoadingChunkMapping,
|
|
130
|
-
moduleToHandlerMapping: __webpack_require__.federation.consumesLoadingModuleToHandlerMapping,
|
|
131
|
-
installedModules: consumesLoadinginstalledModules,
|
|
132
|
-
webpackRequire: __webpack_require__
|
|
133
|
-
}));
|
|
134
|
-
override(__webpack_require__, "I", (name, initScope) => __webpack_require__.federation.bundlerRuntime.I({
|
|
135
|
-
shareScopeName: name,
|
|
136
|
-
initScope,
|
|
137
|
-
initPromises: initializeSharingInitPromises,
|
|
138
|
-
initTokens: initializeSharingInitTokens,
|
|
139
|
-
webpackRequire: __webpack_require__
|
|
140
|
-
}));
|
|
141
|
-
override(__webpack_require__, "initContainer", (shareScope, initScope, remoteEntryInitOptions) => __webpack_require__.federation.bundlerRuntime.initContainerEntry({
|
|
142
|
-
shareScope,
|
|
143
|
-
initScope,
|
|
144
|
-
remoteEntryInitOptions,
|
|
145
|
-
shareScopeKey: containerShareScope,
|
|
146
|
-
webpackRequire: __webpack_require__
|
|
147
|
-
}));
|
|
148
|
-
override(__webpack_require__, "getContainer", (module, getScope) => {
|
|
149
|
-
var moduleMap = __webpack_require__.initializeExposesData.moduleMap;
|
|
150
|
-
__webpack_require__.R = getScope;
|
|
151
|
-
getScope = Object.prototype.hasOwnProperty.call(moduleMap, module)
|
|
152
|
-
? moduleMap[module]()
|
|
153
|
-
: Promise.resolve().then(() => {
|
|
154
|
-
throw new Error('Module "' + module + '" does not exist in container.');
|
|
155
|
-
});
|
|
156
|
-
__webpack_require__.R = undefined;
|
|
157
|
-
return getScope;
|
|
158
|
-
});
|
|
159
|
-
__webpack_require__.federation.instance =
|
|
160
|
-
__webpack_require__.federation.runtime.init(__webpack_require__.federation.initOptions);
|
|
161
|
-
if (__webpack_require__.consumesLoadingData?.initialConsumes) {
|
|
162
|
-
__webpack_require__.federation.bundlerRuntime.installInitialConsumes({
|
|
163
|
-
webpackRequire: __webpack_require__,
|
|
164
|
-
installedModules: consumesLoadinginstalledModules,
|
|
165
|
-
initialConsumes: __webpack_require__.consumesLoadingData.initialConsumes,
|
|
166
|
-
moduleToHandlerMapping: __webpack_require__.federation.consumesLoadingModuleToHandlerMapping
|
|
167
|
-
});
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
};
|
|
1
|
+
var __module_federation_bundler_runtime__,__module_federation_runtime_plugins__,__module_federation_remote_infos__,__module_federation_container_name__;module.exports=function(){if((__webpack_require__.initializeSharingData||__webpack_require__.initializeExposesData)&&__webpack_require__.federation){const override=(obj,key,value)=>{if(!obj)return;if(obj[key])obj[key]=value};const merge=(obj,key,fn)=>{const value=fn();if(Array.isArray(value)){obj[key]??=[];obj[key].push(...value)}else if(typeof value==="object"&&value!==null){obj[key]??={};Object.assign(obj[key],value)}};const early=(obj,key,initial)=>{obj[key]??=initial()};const remotesLoadingChunkMapping=__webpack_require__.remotesLoadingData?.chunkMapping??{};const remotesLoadingModuleIdToRemoteDataMapping=__webpack_require__.remotesLoadingData?.moduleIdToRemoteDataMapping??{};const initializeSharingScopeToInitDataMapping=__webpack_require__.initializeSharingData?.scopeToSharingDataMapping??{};const consumesLoadingChunkMapping=__webpack_require__.consumesLoadingData?.chunkMapping??{};const consumesLoadingModuleToConsumeDataMapping=__webpack_require__.consumesLoadingData?.moduleIdToConsumeDataMapping??{};const consumesLoadinginstalledModules={};const initializeSharingInitPromises=[];const initializeSharingInitTokens=[];const containerShareScope=__webpack_require__.initializeExposesData?.shareScope;for(const key in __module_federation_bundler_runtime__){__webpack_require__.federation[key]=__module_federation_bundler_runtime__[key]}early(__webpack_require__.federation,"consumesLoadingModuleToHandlerMapping",(()=>{const consumesLoadingModuleToHandlerMapping={};for(let[moduleId,data]of Object.entries(consumesLoadingModuleToConsumeDataMapping)){consumesLoadingModuleToHandlerMapping[moduleId]={getter:data.fallback,shareInfo:{shareConfig:{fixedDependencies:false,requiredVersion:data.requiredVersion,strictVersion:data.strictVersion,singleton:data.singleton,eager:data.eager},scope:[data.shareScope]},shareKey:data.shareKey}}return consumesLoadingModuleToHandlerMapping}));early(__webpack_require__.federation,"initOptions",(()=>({})));early(__webpack_require__.federation.initOptions,"name",(()=>__module_federation_container_name__));early(__webpack_require__.federation.initOptions,"shared",(()=>{const shared={};for(let[scope,stages]of Object.entries(initializeSharingScopeToInitDataMapping)){for(let stage of stages){if(typeof stage==="object"&&stage!==null){const{name:name,version:version,factory:factory,eager:eager}=stage;const options={version:version,scope:[scope],get:factory};if(shared[name]){shared[name].push(options)}else{shared[name]=[options]}}}}return shared}));merge(__webpack_require__.federation.initOptions,"remotes",(()=>Object.values(__module_federation_remote_infos__).flat().filter((remote=>remote.externalType==="script"))));merge(__webpack_require__.federation.initOptions,"plugins",(()=>__module_federation_runtime_plugins__));early(__webpack_require__.federation,"bundlerRuntimeOptions",(()=>({})));early(__webpack_require__.federation.bundlerRuntimeOptions,"remotes",(()=>({})));early(__webpack_require__.federation.bundlerRuntimeOptions.remotes,"chunkMapping",(()=>remotesLoadingChunkMapping));early(__webpack_require__.federation.bundlerRuntimeOptions.remotes,"idToExternalAndNameMapping",(()=>{const remotesLoadingIdToExternalAndNameMappingMapping={};for(let[moduleId,data]of Object.entries(remotesLoadingModuleIdToRemoteDataMapping)){remotesLoadingIdToExternalAndNameMappingMapping[moduleId]=[data.shareScope,data.name,data.externalModuleId,data.remoteName]}return remotesLoadingIdToExternalAndNameMappingMapping}));early(__webpack_require__.federation.bundlerRuntimeOptions.remotes,"webpackRequire",(()=>__webpack_require__));merge(__webpack_require__.federation.bundlerRuntimeOptions.remotes,"idToRemoteMap",(()=>{const idToRemoteMap={};for(let[id,remoteData]of Object.entries(remotesLoadingModuleIdToRemoteDataMapping)){const info=__module_federation_remote_infos__[remoteData.remoteName];if(info)idToRemoteMap[id]=info}return idToRemoteMap}));override(__webpack_require__,"S",__webpack_require__.federation.bundlerRuntime.S);if(__webpack_require__.federation.attachShareScopeMap){__webpack_require__.federation.attachShareScopeMap(__webpack_require__)}override(__webpack_require__.f,"remotes",((chunkId,promises)=>__webpack_require__.federation.bundlerRuntime.remotes({chunkId:chunkId,promises:promises,chunkMapping:remotesLoadingChunkMapping,idToExternalAndNameMapping:__webpack_require__.federation.bundlerRuntimeOptions.remotes.idToExternalAndNameMapping,idToRemoteMap:__webpack_require__.federation.bundlerRuntimeOptions.remotes.idToRemoteMap,webpackRequire:__webpack_require__})));override(__webpack_require__.f,"consumes",((chunkId,promises)=>__webpack_require__.federation.bundlerRuntime.consumes({chunkId:chunkId,promises:promises,chunkMapping:consumesLoadingChunkMapping,moduleToHandlerMapping:__webpack_require__.federation.consumesLoadingModuleToHandlerMapping,installedModules:consumesLoadinginstalledModules,webpackRequire:__webpack_require__})));override(__webpack_require__,"I",((name,initScope)=>__webpack_require__.federation.bundlerRuntime.I({shareScopeName:name,initScope:initScope,initPromises:initializeSharingInitPromises,initTokens:initializeSharingInitTokens,webpackRequire:__webpack_require__})));override(__webpack_require__,"initContainer",((shareScope,initScope,remoteEntryInitOptions)=>__webpack_require__.federation.bundlerRuntime.initContainerEntry({shareScope:shareScope,initScope:initScope,remoteEntryInitOptions:remoteEntryInitOptions,shareScopeKey:containerShareScope,webpackRequire:__webpack_require__})));override(__webpack_require__,"getContainer",((module,getScope)=>{var moduleMap=__webpack_require__.initializeExposesData.moduleMap;__webpack_require__.R=getScope;getScope=Object.prototype.hasOwnProperty.call(moduleMap,module)?moduleMap[module]():Promise.resolve().then((()=>{throw new Error('Module "'+module+'" does not exist in container.')}));__webpack_require__.R=undefined;return getScope}));__webpack_require__.federation.instance=__webpack_require__.federation.runtime.init(__webpack_require__.federation.initOptions);if(__webpack_require__.consumesLoadingData?.initialConsumes){__webpack_require__.federation.bundlerRuntime.installInitialConsumes({webpackRequire:__webpack_require__,installedModules:consumesLoadinginstalledModules,initialConsumes:__webpack_require__.consumesLoadingData.initialConsumes,moduleToHandlerMapping:__webpack_require__.federation.consumesLoadingModuleToHandlerMapping})}}};
|
package/dist/exports.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ import Template = require("./Template");
|
|
|
22
22
|
export { Template };
|
|
23
23
|
export declare const WebpackError: ErrorConstructor;
|
|
24
24
|
export type { Watching } from "./Watching";
|
|
25
|
-
|
|
25
|
+
import sources = require("../compiled/webpack-sources");
|
|
26
26
|
export { sources };
|
|
27
27
|
import { applyRspackOptionsDefaults, getNormalizedRspackOptions } from "./config";
|
|
28
28
|
type Config = {
|
|
@@ -39,7 +39,6 @@ export declare const util: {
|
|
|
39
39
|
};
|
|
40
40
|
export { default as EntryOptionPlugin } from "./lib/EntryOptionPlugin";
|
|
41
41
|
export { type OutputFileSystem } from "./util/fs";
|
|
42
|
-
export { cleanupGlobalTrace as experimental_cleanupGlobalTrace, registerGlobalTrace as experimental_registerGlobalTrace } from "@rspack/binding";
|
|
43
42
|
export type { BannerPluginArgument } from "./builtin-plugin";
|
|
44
43
|
export type { ProvidePluginOptions } from "./builtin-plugin";
|
|
45
44
|
export type { DefinePluginOptions } from "./builtin-plugin";
|
|
@@ -149,3 +148,11 @@ export { EvalSourceMapDevToolPlugin } from "./builtin-plugin";
|
|
|
149
148
|
export { EvalDevToolModulePlugin } from "./builtin-plugin";
|
|
150
149
|
export { CssExtractRspackPlugin } from "./builtin-plugin";
|
|
151
150
|
export type { SwcLoaderEnvConfig, SwcLoaderEsParserConfig, SwcLoaderJscConfig, SwcLoaderModuleConfig, SwcLoaderOptions, SwcLoaderParserConfig, SwcLoaderTransformConfig, SwcLoaderTsParserConfig } from "./builtin-loader/swc/index";
|
|
151
|
+
import { cleanupGlobalTrace, registerGlobalTrace } from "@rspack/binding";
|
|
152
|
+
interface Experiments {
|
|
153
|
+
globalTrace: {
|
|
154
|
+
register: typeof registerGlobalTrace;
|
|
155
|
+
cleanup: typeof cleanupGlobalTrace;
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
export declare const experiments: Experiments;
|
package/dist/exports.js
CHANGED
|
@@ -26,8 +26,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.EvalSourceMapDevToolPlugin = exports.SourceMapDevToolPlugin = exports.CopyRspackPlugin = exports.LightningCssMinimizerRspackPlugin = exports.SwcCssMinimizerRspackPlugin = exports.SwcJsMinimizerRspackPlugin = exports.HtmlRspackPlugin = exports.sharing = exports.container = exports.optimize = exports.webworker = exports.javascript = exports.wasm = exports.library = exports.electron = exports.node = exports.web = exports.NormalModuleReplacementPlugin = exports.LoaderTargetPlugin = exports.LoaderOptionsPlugin = exports.EnvironmentPlugin = exports.HotModuleReplacementPlugin = exports.ExternalsPlugin = exports.DynamicEntryPlugin = exports.EntryPlugin = exports.ProgressPlugin = exports.DefinePlugin = exports.ProvidePlugin = exports.IgnorePlugin = exports.BannerPlugin = exports.
|
|
30
|
-
exports.
|
|
29
|
+
exports.CssExtractRspackPlugin = exports.EvalDevToolModulePlugin = exports.EvalSourceMapDevToolPlugin = exports.SourceMapDevToolPlugin = exports.CopyRspackPlugin = exports.LightningCssMinimizerRspackPlugin = exports.SwcCssMinimizerRspackPlugin = exports.SwcJsMinimizerRspackPlugin = exports.HtmlRspackPlugin = exports.sharing = exports.container = exports.optimize = exports.webworker = exports.javascript = exports.wasm = exports.library = exports.electron = exports.node = exports.web = exports.NormalModuleReplacementPlugin = exports.LoaderTargetPlugin = exports.LoaderOptionsPlugin = exports.EnvironmentPlugin = exports.HotModuleReplacementPlugin = exports.ExternalsPlugin = exports.DynamicEntryPlugin = exports.EntryPlugin = exports.ProgressPlugin = exports.DefinePlugin = exports.ProvidePlugin = exports.IgnorePlugin = exports.BannerPlugin = exports.EntryOptionPlugin = exports.util = exports.config = exports.sources = exports.WebpackError = exports.Template = exports.ModuleFilenameHelpers = exports.Stats = exports.RuntimeGlobals = exports.NormalModule = exports.MultiStats = exports.WebpackOptionsApply = exports.RspackOptionsApply = exports.MultiCompiler = exports.Compiler = exports.Compilation = exports.version = exports.rspackVersion = void 0;
|
|
30
|
+
exports.experiments = void 0;
|
|
31
31
|
const { version: rspackVersion, webpackVersion } = require("../package.json");
|
|
32
32
|
exports.rspackVersion = rspackVersion;
|
|
33
33
|
exports.version = webpackVersion;
|
|
@@ -55,7 +55,7 @@ exports.ModuleFilenameHelpers = ModuleFilenameHelpers;
|
|
|
55
55
|
const Template = require("./Template");
|
|
56
56
|
exports.Template = Template;
|
|
57
57
|
exports.WebpackError = Error;
|
|
58
|
-
const sources = require("webpack-sources");
|
|
58
|
+
const sources = require("../compiled/webpack-sources");
|
|
59
59
|
exports.sources = sources;
|
|
60
60
|
const config_1 = require("./config");
|
|
61
61
|
exports.config = {
|
|
@@ -69,9 +69,6 @@ const createHash_1 = require("./util/createHash");
|
|
|
69
69
|
exports.util = { createHash: createHash_1.createHash, cleverMerge: cleverMerge_1.cachedCleverMerge };
|
|
70
70
|
var EntryOptionPlugin_1 = require("./lib/EntryOptionPlugin");
|
|
71
71
|
Object.defineProperty(exports, "EntryOptionPlugin", { enumerable: true, get: function () { return __importDefault(EntryOptionPlugin_1).default; } });
|
|
72
|
-
var binding_1 = require("@rspack/binding");
|
|
73
|
-
Object.defineProperty(exports, "experimental_cleanupGlobalTrace", { enumerable: true, get: function () { return binding_1.cleanupGlobalTrace; } });
|
|
74
|
-
Object.defineProperty(exports, "experimental_registerGlobalTrace", { enumerable: true, get: function () { return binding_1.registerGlobalTrace; } });
|
|
75
72
|
var builtin_plugin_1 = require("./builtin-plugin");
|
|
76
73
|
Object.defineProperty(exports, "BannerPlugin", { enumerable: true, get: function () { return builtin_plugin_1.BannerPlugin; } });
|
|
77
74
|
var builtin_plugin_2 = require("./builtin-plugin");
|
|
@@ -167,3 +164,11 @@ var builtin_plugin_27 = require("./builtin-plugin");
|
|
|
167
164
|
Object.defineProperty(exports, "EvalDevToolModulePlugin", { enumerable: true, get: function () { return builtin_plugin_27.EvalDevToolModulePlugin; } });
|
|
168
165
|
var builtin_plugin_28 = require("./builtin-plugin");
|
|
169
166
|
Object.defineProperty(exports, "CssExtractRspackPlugin", { enumerable: true, get: function () { return builtin_plugin_28.CssExtractRspackPlugin; } });
|
|
167
|
+
///// Experiments Stuff /////
|
|
168
|
+
const binding_1 = require("@rspack/binding");
|
|
169
|
+
exports.experiments = {
|
|
170
|
+
globalTrace: {
|
|
171
|
+
register: binding_1.registerGlobalTrace,
|
|
172
|
+
cleanup: binding_1.cleanupGlobalTrace
|
|
173
|
+
}
|
|
174
|
+
};
|
package/dist/lib/Cache.d.ts
CHANGED
|
@@ -56,13 +56,13 @@ declare class Cache {
|
|
|
56
56
|
declare namespace Cache {
|
|
57
57
|
export { STAGE_MEMORY, STAGE_DEFAULT, STAGE_DISK, STAGE_NETWORK, WebpackError, Etag, CallbackCache, GotHandler };
|
|
58
58
|
}
|
|
59
|
-
import { AsyncSeriesBailHook } from "tapable";
|
|
59
|
+
import { AsyncSeriesBailHook } from "@rspack/lite-tapable";
|
|
60
60
|
type Etag = {
|
|
61
61
|
toString: () => string;
|
|
62
62
|
};
|
|
63
63
|
type GotHandler = (result: any, callback: (arg0: Error | undefined) => void) => void;
|
|
64
|
-
import { AsyncParallelHook } from "tapable";
|
|
65
|
-
import { SyncHook } from "tapable";
|
|
64
|
+
import { AsyncParallelHook } from "@rspack/lite-tapable";
|
|
65
|
+
import { SyncHook } from "@rspack/lite-tapable";
|
|
66
66
|
type CallbackCache<T> = (err?: (WebpackError | null) | undefined, result?: T | undefined) => void;
|
|
67
67
|
declare var STAGE_MEMORY: number;
|
|
68
68
|
declare var STAGE_DEFAULT: number;
|
package/dist/lib/Cache.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Author Tobias Koppers @sokra
|
|
4
4
|
*/
|
|
5
5
|
"use strict";
|
|
6
|
-
const { AsyncParallelHook, AsyncSeriesBailHook, SyncHook } = require("tapable");
|
|
6
|
+
const { AsyncParallelHook, AsyncSeriesBailHook, SyncHook } = require("@rspack/lite-tapable");
|
|
7
7
|
const { makeWebpackError, makeWebpackErrorCallback } = require("./HookWebpackError.js");
|
|
8
8
|
/** @typedef {import("./WebpackError")} WebpackError */
|
|
9
9
|
/**
|
|
@@ -29,9 +29,10 @@ const node_querystring_1 = __importDefault(require("node:querystring"));
|
|
|
29
29
|
const assert_1 = __importDefault(require("assert"));
|
|
30
30
|
const util_1 = require("util");
|
|
31
31
|
const binding_1 = require("@rspack/binding");
|
|
32
|
-
const webpack_sources_1 = require("webpack-sources");
|
|
32
|
+
const webpack_sources_1 = require("../../compiled/webpack-sources");
|
|
33
33
|
const Module_1 = require("../Module");
|
|
34
34
|
const NormalModule_1 = require("../NormalModule");
|
|
35
|
+
const RspackError_1 = require("../RspackError");
|
|
35
36
|
const adapterRuleUse_1 = require("../config/adapterRuleUse");
|
|
36
37
|
const util_2 = require("../util");
|
|
37
38
|
const createHash_1 = require("../util/createHash");
|
|
@@ -213,17 +214,21 @@ const runSyncOrAsync = (0, util_1.promisify)(function runSyncOrAsync(fn, context
|
|
|
213
214
|
})();
|
|
214
215
|
if (isSync) {
|
|
215
216
|
isDone = true;
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
217
|
+
if (result === undefined) {
|
|
218
|
+
// @ts-expect-error
|
|
219
|
+
callback();
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
219
222
|
if (result &&
|
|
220
223
|
typeof result === "object" &&
|
|
221
224
|
typeof result.then === "function") {
|
|
222
|
-
|
|
225
|
+
result.then(function (r) {
|
|
223
226
|
callback(null, [r]);
|
|
224
227
|
}, callback);
|
|
228
|
+
return;
|
|
225
229
|
}
|
|
226
|
-
|
|
230
|
+
callback(null, [result]);
|
|
231
|
+
return;
|
|
227
232
|
}
|
|
228
233
|
}
|
|
229
234
|
catch (e) {
|
|
@@ -517,14 +522,34 @@ async function runLoaders(compiler, context) {
|
|
|
517
522
|
};
|
|
518
523
|
loaderContext.rootContext = compiler.context;
|
|
519
524
|
loaderContext.emitError = function emitError(error) {
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
525
|
+
if (!(error instanceof Error)) {
|
|
526
|
+
error = new RspackError_1.NonErrorEmittedError(error);
|
|
527
|
+
}
|
|
528
|
+
let hasStack = !!error.stack;
|
|
529
|
+
error.name = "ModuleError";
|
|
530
|
+
error.message = `${error.message} (from: ${(0, util_2.stringifyLoaderObject)(loaderContext.loaders[loaderContext.loaderIndex])})`;
|
|
531
|
+
hasStack && Error.captureStackTrace(error);
|
|
532
|
+
error = (0, util_2.concatErrorMsgAndStack)(error);
|
|
533
|
+
error.moduleIdentifier = this._module.identifier();
|
|
534
|
+
compiler._lastCompilation.__internal__pushDiagnostic({
|
|
535
|
+
error,
|
|
536
|
+
severity: binding_1.JsRspackSeverity.Error
|
|
537
|
+
});
|
|
523
538
|
};
|
|
524
539
|
loaderContext.emitWarning = function emitWarning(warning) {
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
540
|
+
if (!(warning instanceof Error)) {
|
|
541
|
+
warning = new RspackError_1.NonErrorEmittedError(warning);
|
|
542
|
+
}
|
|
543
|
+
let hasStack = !!warning.stack;
|
|
544
|
+
warning.name = "ModuleWarning";
|
|
545
|
+
warning.message = `${warning.message} (from: ${(0, util_2.stringifyLoaderObject)(loaderContext.loaders[loaderContext.loaderIndex])})`;
|
|
546
|
+
hasStack && Error.captureStackTrace(warning);
|
|
547
|
+
warning = (0, util_2.concatErrorMsgAndStack)(warning);
|
|
548
|
+
warning.moduleIdentifier = this._module.identifier();
|
|
549
|
+
compiler._lastCompilation.__internal__pushDiagnostic({
|
|
550
|
+
error: warning,
|
|
551
|
+
severity: binding_1.JsRspackSeverity.Warn
|
|
552
|
+
});
|
|
528
553
|
};
|
|
529
554
|
loaderContext.emitFile = function emitFile(name, content, sourceMap, assetInfo) {
|
|
530
555
|
let source;
|
package/dist/rspack.d.ts
CHANGED
|
@@ -53,6 +53,9 @@ class RspackOptionsApply {
|
|
|
53
53
|
!options.externalsPresets.electronRenderer) {
|
|
54
54
|
new builtin_plugin_1.ElectronTargetPlugin().apply(compiler);
|
|
55
55
|
}
|
|
56
|
+
if (options.externalsPresets.nwjs) {
|
|
57
|
+
new builtin_plugin_1.ExternalsPlugin("node-commonjs", "nw.gui").apply(compiler);
|
|
58
|
+
}
|
|
56
59
|
if (options.externalsPresets.web ||
|
|
57
60
|
options.externalsPresets.webAsync ||
|
|
58
61
|
(options.externalsPresets.node && options.experiments.css)) {
|
|
@@ -277,13 +277,23 @@ const SORTERS = {
|
|
|
277
277
|
_: comparators => {
|
|
278
278
|
comparators.push((0, comparators_1.compareSelect)((c) => c.id, compareIds));
|
|
279
279
|
}
|
|
280
|
-
}
|
|
280
|
+
},
|
|
281
281
|
// "compilation.modules": MODULES_SORTER,
|
|
282
282
|
// "chunk.rootModules": MODULES_SORTER,
|
|
283
283
|
// "chunk.modules": MODULES_SORTER,
|
|
284
284
|
// "module.modules": MODULES_SORTER,
|
|
285
285
|
// not support module.reasons (missing Module.identifier())
|
|
286
|
-
|
|
286
|
+
"chunk.origins": {
|
|
287
|
+
_: comparators => {
|
|
288
|
+
comparators.push(
|
|
289
|
+
// compareSelect(
|
|
290
|
+
// origin =>
|
|
291
|
+
// origin.module ? chunkGraph.getModuleId(origin.module) : undefined,
|
|
292
|
+
// compareIds
|
|
293
|
+
// ),
|
|
294
|
+
(0, comparators_1.compareSelect)((origin) => origin.loc, compareIds), (0, comparators_1.compareSelect)((origin) => origin.request, compareIds));
|
|
295
|
+
}
|
|
296
|
+
}
|
|
287
297
|
};
|
|
288
298
|
const SIMPLE_EXTRACTORS = {
|
|
289
299
|
compilation: {
|
|
@@ -499,9 +509,11 @@ const SIMPLE_EXTRACTORS = {
|
|
|
499
509
|
object.modules = limited.children;
|
|
500
510
|
object.filteredModules = limited.filteredChildren;
|
|
501
511
|
},
|
|
502
|
-
entrypoints: (object, compilation, context,
|
|
512
|
+
entrypoints: (object, compilation, context, { chunkGroupAuxiliary, chunkGroupChildren }, _factory) => {
|
|
503
513
|
// const { type } = context;
|
|
504
|
-
const array = context
|
|
514
|
+
const array = context
|
|
515
|
+
.getInner(compilation)
|
|
516
|
+
.getEntrypoints(chunkGroupAuxiliary, chunkGroupChildren);
|
|
505
517
|
// object.entrypoints = factory.create(
|
|
506
518
|
// `${type}.entrypoints`,
|
|
507
519
|
// array,
|
|
@@ -512,11 +524,11 @@ const SIMPLE_EXTRACTORS = {
|
|
|
512
524
|
return acc;
|
|
513
525
|
}, {});
|
|
514
526
|
},
|
|
515
|
-
chunkGroups: (object, compilation, context,
|
|
527
|
+
chunkGroups: (object, compilation, context, { chunkGroupAuxiliary, chunkGroupChildren }, factory) => {
|
|
516
528
|
// const { type } = context;
|
|
517
529
|
const namedChunkGroups = context
|
|
518
530
|
.getInner(compilation)
|
|
519
|
-
.getNamedChunkGroups();
|
|
531
|
+
.getNamedChunkGroups(chunkGroupAuxiliary, chunkGroupChildren);
|
|
520
532
|
// object.namedChunkGroups = factory.create(
|
|
521
533
|
// `${type}.namedChunkGroups`,
|
|
522
534
|
// namedChunkGroups,
|
|
@@ -555,7 +567,10 @@ const SIMPLE_EXTRACTORS = {
|
|
|
555
567
|
object.name = asset.name;
|
|
556
568
|
object.size = asset.size;
|
|
557
569
|
object.emitted = asset.emitted;
|
|
558
|
-
object.info =
|
|
570
|
+
object.info = {
|
|
571
|
+
...asset.info,
|
|
572
|
+
related: Object.fromEntries(asset.info.related.map(i => [i.name, i.value]))
|
|
573
|
+
};
|
|
559
574
|
Object.assign(object, factory.create(`${context.type}$visible`, asset, context));
|
|
560
575
|
}
|
|
561
576
|
},
|
|
@@ -590,12 +605,14 @@ const SIMPLE_EXTRACTORS = {
|
|
|
590
605
|
object.identifier = module.identifier;
|
|
591
606
|
object.name = module.name;
|
|
592
607
|
object.nameForCondition = module.nameForCondition;
|
|
608
|
+
object.index = module.preOrderIndex;
|
|
593
609
|
object.preOrderIndex = module.preOrderIndex;
|
|
610
|
+
object.index2 = module.postOrderIndex;
|
|
594
611
|
object.postOrderIndex = module.postOrderIndex;
|
|
595
612
|
object.cacheable = module.cacheable;
|
|
596
613
|
object.optional = module.optional;
|
|
597
614
|
object.orphan = module.orphan;
|
|
598
|
-
|
|
615
|
+
object.dependent = module.dependent;
|
|
599
616
|
object.issuer = module.issuer;
|
|
600
617
|
object.issuerName = module.issuerName;
|
|
601
618
|
object.issuerPath = factory.create(`${type.slice(0, -8)}.issuerPath`, module.issuerPath, context);
|
|
@@ -667,12 +684,10 @@ const SIMPLE_EXTRACTORS = {
|
|
|
667
684
|
profile: {
|
|
668
685
|
_: (object, profile) => {
|
|
669
686
|
const factory = (0, statsFactoryUtils_1.resolveStatsMillisecond)(profile.factory);
|
|
670
|
-
const integration = (0, statsFactoryUtils_1.resolveStatsMillisecond)(profile.integration);
|
|
671
687
|
const building = (0, statsFactoryUtils_1.resolveStatsMillisecond)(profile.building);
|
|
672
688
|
const statsProfile = {
|
|
673
|
-
total: factory +
|
|
689
|
+
total: factory + building,
|
|
674
690
|
resolving: factory,
|
|
675
|
-
integration,
|
|
676
691
|
building
|
|
677
692
|
};
|
|
678
693
|
Object.assign(object, statsProfile);
|
|
@@ -701,12 +716,18 @@ const SIMPLE_EXTRACTORS = {
|
|
|
701
716
|
chunk: {
|
|
702
717
|
_: (object, chunk) => {
|
|
703
718
|
object.type = chunk.type;
|
|
719
|
+
object.rendered = chunk.rendered;
|
|
704
720
|
object.initial = chunk.initial;
|
|
705
721
|
object.entry = chunk.entry;
|
|
722
|
+
object.reason = chunk.reason;
|
|
706
723
|
object.size = chunk.size;
|
|
724
|
+
object.sizes = Object.fromEntries(chunk.sizes.map(({ sourceType, size }) => [sourceType, size]));
|
|
707
725
|
object.names = chunk.names;
|
|
726
|
+
object.idHints = chunk.idHints;
|
|
727
|
+
object.runtime = chunk.runtime;
|
|
708
728
|
object.files = chunk.files;
|
|
709
729
|
object.auxiliaryFiles = chunk.auxiliaryFiles;
|
|
730
|
+
object.hash = chunk.hash;
|
|
710
731
|
object.childrenByOrder = chunk.childrenByOrder;
|
|
711
732
|
},
|
|
712
733
|
ids: (object, chunk) => {
|
|
@@ -720,6 +741,9 @@ const SIMPLE_EXTRACTORS = {
|
|
|
720
741
|
chunkModules: (object, chunk, context, options, factory) => {
|
|
721
742
|
const { type } = context;
|
|
722
743
|
object.modules = factory.create(`${type}.modules`, chunk.modules, context);
|
|
744
|
+
},
|
|
745
|
+
chunkOrigins: (object, chunk, context, options, factory) => {
|
|
746
|
+
object.origins = chunk.origins;
|
|
723
747
|
}
|
|
724
748
|
}
|
|
725
749
|
};
|