@rspack/core 1.7.0-beta.0 → 1.7.0-beta.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/dist/config/normalization.d.ts +0 -4
- package/dist/config/types.d.ts +8 -6
- package/dist/cssExtractHmr.js +2 -2
- package/dist/cssExtractLoader.js +1 -1
- package/dist/index.js +24 -21
- package/dist/moduleFederationDefaultRuntime.js +1 -1
- package/dist/rspack.d.ts +9 -0
- package/dist/util/index.d.ts +1 -0
- package/dist/worker.js +4 -4
- package/package.json +6 -6
|
@@ -111,10 +111,6 @@ export interface ExperimentsNormalized {
|
|
|
111
111
|
*/
|
|
112
112
|
layers?: boolean;
|
|
113
113
|
incremental?: false | Incremental;
|
|
114
|
-
/**
|
|
115
|
-
* @deprecated This option is deprecated, as it has a huge regression in some edge cases where the chunk graph has lots of cycles. We will improve performance of build_chunk_graph.
|
|
116
|
-
*/
|
|
117
|
-
parallelCodeSplitting?: boolean;
|
|
118
114
|
futureDefaults?: boolean;
|
|
119
115
|
rspackFuture?: RspackFutureOptions;
|
|
120
116
|
buildHttp?: HttpUriPluginOptions;
|
package/dist/config/types.d.ts
CHANGED
|
@@ -461,7 +461,13 @@ export type Output = {
|
|
|
461
461
|
/** An optional salt to update the hash. */
|
|
462
462
|
hashSalt?: HashSalt;
|
|
463
463
|
/**
|
|
464
|
-
*
|
|
464
|
+
* Controls whether dynamically imported modules are emitted as separate async chunks or bundled into
|
|
465
|
+
* existing chunks.
|
|
466
|
+
* - `true`: Modules loaded via `import()` are split into independent async chunks. These chunks are
|
|
467
|
+
* emitted as separate files and are loaded on demand at runtime. This enables code splitting and keeps
|
|
468
|
+
* the initial bundle smaller.
|
|
469
|
+
* - `false`: Dynamically imported modules are bundled into existing chunks instead of being emitted as
|
|
470
|
+
* separate files. No additional async chunk files are generated.
|
|
465
471
|
* @default true
|
|
466
472
|
* */
|
|
467
473
|
asyncChunks?: AsyncChunks;
|
|
@@ -2097,6 +2103,7 @@ export type Experiments = {
|
|
|
2097
2103
|
outputModule?: boolean;
|
|
2098
2104
|
/**
|
|
2099
2105
|
* Enable top-level await.
|
|
2106
|
+
* @deprecated This option is deprecated, top-level await is enabled by default.
|
|
2100
2107
|
* @default true
|
|
2101
2108
|
*/
|
|
2102
2109
|
topLevelAwait?: boolean;
|
|
@@ -2123,11 +2130,6 @@ export type Experiments = {
|
|
|
2123
2130
|
* Enable incremental builds.
|
|
2124
2131
|
*/
|
|
2125
2132
|
incremental?: IncrementalPresets | Incremental;
|
|
2126
|
-
/**
|
|
2127
|
-
* Enable multi-threaded code splitting algorithm.
|
|
2128
|
-
* @deprecated This option is deprecated, it has a huge regression in some edge cases where the chunk graph has lots of cycles. We'll improve the performance of build_chunk_graph in the future instead
|
|
2129
|
-
*/
|
|
2130
|
-
parallelCodeSplitting?: boolean;
|
|
2131
2133
|
/**
|
|
2132
2134
|
* Enable future default options.
|
|
2133
2135
|
* @default false
|
package/dist/cssExtractHmr.js
CHANGED
|
@@ -6,7 +6,7 @@ __webpack_require__.d = (exports1, definition)=>{
|
|
|
6
6
|
get: definition[key]
|
|
7
7
|
});
|
|
8
8
|
}, __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop), __webpack_require__.r = (exports1)=>{
|
|
9
|
-
|
|
9
|
+
"u" > typeof Symbol && Symbol.toStringTag && Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
10
10
|
value: 'Module'
|
|
11
11
|
}), Object.defineProperty(exports1, '__esModule', {
|
|
12
12
|
value: !0
|
|
@@ -34,7 +34,7 @@ __webpack_require__.r(__webpack_exports__), __webpack_require__.d(__webpack_expo
|
|
|
34
34
|
cssReload: ()=>cssReload,
|
|
35
35
|
normalizeUrl: ()=>normalizeUrl
|
|
36
36
|
});
|
|
37
|
-
const srcByModuleId = Object.create(null), noDocument = "
|
|
37
|
+
const srcByModuleId = Object.create(null), noDocument = "u" < typeof document, { forEach } = Array.prototype;
|
|
38
38
|
function noop() {}
|
|
39
39
|
function updateCss(el, url) {
|
|
40
40
|
let normalizedUrl;
|
package/dist/cssExtractLoader.js
CHANGED
|
@@ -11,7 +11,7 @@ __webpack_require__.n = (module)=>{
|
|
|
11
11
|
get: definition[key]
|
|
12
12
|
});
|
|
13
13
|
}, __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop), __webpack_require__.r = (exports1)=>{
|
|
14
|
-
|
|
14
|
+
"u" > typeof Symbol && Symbol.toStringTag && Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
15
15
|
value: 'Module'
|
|
16
16
|
}), Object.defineProperty(exports1, '__esModule', {
|
|
17
17
|
value: !0
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __webpack_modules__ = {
|
|
3
|
-
"../../node_modules/.pnpm/enhanced-resolve@5.18.
|
|
3
|
+
"../../node_modules/.pnpm/enhanced-resolve@5.18.4/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js" (module1, __unused_rspack_exports, __webpack_require__) {
|
|
4
4
|
let { nextTick } = __webpack_require__("process"), dirname = (path)=>{
|
|
5
5
|
let idx = path.length - 1;
|
|
6
6
|
for(; idx >= 0;){
|
|
@@ -264,7 +264,7 @@ __webpack_require__.n = (module1)=>{
|
|
|
264
264
|
get: definition[key]
|
|
265
265
|
});
|
|
266
266
|
}, __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop), __webpack_require__.r = (exports1)=>{
|
|
267
|
-
|
|
267
|
+
"u" > typeof Symbol && Symbol.toStringTag && Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
268
268
|
value: 'Module'
|
|
269
269
|
}), Object.defineProperty(exports1, '__esModule', {
|
|
270
270
|
value: !0
|
|
@@ -2306,7 +2306,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
|
2306
2306
|
var config;
|
|
2307
2307
|
let err, logger = compiler.getInfrastructureLogger(EsmLibraryPlugin.PLUGIN_NAME);
|
|
2308
2308
|
if (!function(options, logger) {
|
|
2309
|
-
options.optimization.concatenateModules = !1, options.optimization.removeEmptyChunks = !1, options.output.chunkFormat = !1, options.output.chunkLoading && "import" !== options.output.chunkLoading && (logger.warn(`\`output.chunkLoading\` should be \`"import"\` or \`false\`, but got ${options.output.chunkLoading}, changed it to \`"import"\``), options.output.chunkLoading = "import"), void 0 === options.output.chunkLoading && (options.output.chunkLoading = "import"), options.output.library && (options.output.library = void 0);
|
|
2309
|
+
options.optimization.concatenateModules = !1, options.optimization.removeEmptyChunks = !1, options.output.chunkFormat = !1, options.output.module = !0, options.output.chunkLoading && "import" !== options.output.chunkLoading && (logger.warn(`\`output.chunkLoading\` should be \`"import"\` or \`false\`, but got ${options.output.chunkLoading}, changed it to \`"import"\``), options.output.chunkLoading = "import"), void 0 === options.output.chunkLoading && (options.output.chunkLoading = "import"), options.output.library && (options.output.library = void 0);
|
|
2310
2310
|
let { splitChunks } = options.optimization;
|
|
2311
2311
|
void 0 === splitChunks && (splitChunks = options.optimization.splitChunks = {}), !1 !== splitChunks && (splitChunks.chunks = "all", splitChunks.minSize = 0, splitChunks.maxAsyncRequests = 1 / 0, splitChunks.maxInitialRequests = 1 / 0, splitChunks.cacheGroups ??= {}, splitChunks.cacheGroups.default = !1, splitChunks.cacheGroups.defaultVendors = !1);
|
|
2312
2312
|
}(compiler.options, logger), new RemoveDuplicateModulesPlugin().apply(compiler), err = (config = compiler.options).optimization.concatenateModules ? "You should disable `config.optimization.concatenateModules`" : !1 !== config.output.chunkFormat ? "You should disable default chunkFormat by `config.output.chunkFormat = false`" : void 0) throw new src_0.WebpackError(`Conflicted config for ${EsmLibraryPlugin.PLUGIN_NAME}: ${err}`);
|
|
@@ -2335,9 +2335,13 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
|
2335
2335
|
return o.path + o.query + o.fragment;
|
|
2336
2336
|
}
|
|
2337
2337
|
let unsupported = (name, issue)=>{
|
|
2338
|
-
let s = `${name} is not supported by
|
|
2339
|
-
throw issue && (s += `
|
|
2340
|
-
},
|
|
2338
|
+
let s = `${name} is not supported by Rspack.`;
|
|
2339
|
+
throw issue && (s += ` Refer to issue ${issue} for more information.`), Error(s);
|
|
2340
|
+
}, warnedMessages = new Set();
|
|
2341
|
+
function deprecate(message) {
|
|
2342
|
+
warnedMessages.has(message) || (warnedMessages.add(message), console.warn(`[Rspack Deprecation] ${message}`));
|
|
2343
|
+
}
|
|
2344
|
+
let WINDOWS_ABS_PATH_REGEXP = /^[a-zA-Z]:[\\/]/, SEGMENTS_SPLIT_REGEXP = /([|!])/, WINDOWS_PATH_SEPARATOR_REGEXP = /\\/g, relativePathToRequest = (relativePath)=>"" === relativePath ? "./." : ".." === relativePath ? "../." : relativePath.startsWith("../") ? relativePath : `./${relativePath}`, absoluteToRequest = (context, maybeAbsolutePath)=>{
|
|
2341
2345
|
if ("/" === maybeAbsolutePath[0]) {
|
|
2342
2346
|
if (maybeAbsolutePath.length > 1 && "/" === maybeAbsolutePath[maybeAbsolutePath.length - 1]) return maybeAbsolutePath;
|
|
2343
2347
|
let querySplitPos = maybeAbsolutePath.indexOf("?"), resource = -1 === querySplitPos ? maybeAbsolutePath : maybeAbsolutePath.slice(0, querySplitPos);
|
|
@@ -4462,9 +4466,9 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
|
4462
4466
|
"function" == typeof next && next();
|
|
4463
4467
|
}, DEPRECATED_LAZY_COMPILATION_OPTIONS_WARN = "The `experiments.lazyCompilation` option is deprecated, please use the configuration top level `lazyCompilation` instead.", REPEAT_LAZY_COMPILATION_OPTIONS_WARN = "Both top-level `lazyCompilation` and `experiments.lazyCompilation` options are set. The top-level `lazyCompilation` configuration will take precedence.", lazyCompilationMiddleware = (compiler)=>{
|
|
4464
4468
|
if (compiler instanceof MultiCompiler) {
|
|
4465
|
-
let middlewareByCompiler = new Map(), i = 0
|
|
4469
|
+
let middlewareByCompiler = new Map(), i = 0;
|
|
4466
4470
|
for (let c of compiler.compilers){
|
|
4467
|
-
if (c.options.experiments.lazyCompilation && (c.name ?
|
|
4471
|
+
if (c.options.experiments.lazyCompilation && (c.name ? deprecate(`The 'experiments.lazyCompilation' option in compiler named '${c.name}' is deprecated, please use the Configuration top level 'lazyCompilation' instead.`) : deprecate(DEPRECATED_LAZY_COMPILATION_OPTIONS_WARN)), c.options.lazyCompilation && c.options.experiments.lazyCompilation && (c.name ? deprecate(`The top-level 'lazyCompilation' option in compiler named '${c.name}' will override the 'experiments.lazyCompilation' option.`) : deprecate(REPEAT_LAZY_COMPILATION_OPTIONS_WARN)), !c.options.lazyCompilation && !c.options.experiments.lazyCompilation) continue;
|
|
4468
4472
|
let options = {
|
|
4469
4473
|
...c.options.experiments.lazyCompilation,
|
|
4470
4474
|
...c.options.lazyCompilation
|
|
@@ -4483,7 +4487,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
|
4483
4487
|
return middleware?.(req, res, next);
|
|
4484
4488
|
};
|
|
4485
4489
|
}
|
|
4486
|
-
if (compiler.options.experiments.lazyCompilation && (
|
|
4490
|
+
if (compiler.options.experiments.lazyCompilation && (deprecate(DEPRECATED_LAZY_COMPILATION_OPTIONS_WARN), compiler.options.lazyCompilation && deprecate(REPEAT_LAZY_COMPILATION_OPTIONS_WARN)), !compiler.options.lazyCompilation && !compiler.options.experiments.lazyCompilation) return noop;
|
|
4487
4491
|
let activeModules = new Set(), options = {
|
|
4488
4492
|
...compiler.options.experiments.lazyCompilation,
|
|
4489
4493
|
...compiler.options.lazyCompilation
|
|
@@ -5830,9 +5834,9 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
5830
5834
|
let tty = infrastructureLogging.stream?.isTTY && "dumb" !== process.env.TERM;
|
|
5831
5835
|
D(infrastructureLogging, "level", "info"), D(infrastructureLogging, "debug", !1), D(infrastructureLogging, "colors", tty), D(infrastructureLogging, "appendOnly", !tty);
|
|
5832
5836
|
}, applyExperimentsDefaults = (experiments, { development })=>{
|
|
5833
|
-
F(experiments, "cache", ()=>development), D(experiments, "futureDefaults", !1), D(experiments, "lazyCompilation", !1), D(experiments, "asyncWebAssembly", experiments.futureDefaults), D(experiments, "css", !!experiments.futureDefaults || void 0), D(experiments, "topLevelAwait", !0), D(experiments, "deferImport", !1), D(experiments, "buildHttp", void 0), experiments.buildHttp && "object" == typeof experiments.buildHttp && D(experiments.buildHttp, "upgrade", !1), D(experiments, "incremental", {}), "object" == typeof experiments.incremental && (D(experiments.incremental, "silent", !0), D(experiments.incremental, "make", !0), D(experiments.incremental, "inferAsyncModules", !0), D(experiments.incremental, "providedExports", !0), D(experiments.incremental, "dependenciesDiagnostics", !0), D(experiments.incremental, "sideEffects", !0), D(experiments.incremental, "buildChunkGraph", !1), D(experiments.incremental, "moduleIds", !0), D(experiments.incremental, "chunkIds", !0), D(experiments.incremental, "modulesHashes", !0), D(experiments.incremental, "modulesCodegen", !0), D(experiments.incremental, "modulesRuntimeRequirements", !0), D(experiments.incremental, "chunksRuntimeRequirements", !0), D(experiments.incremental, "chunksHashes", !0), D(experiments.incremental, "chunksRender", !0), D(experiments.incremental, "emitAssets", !0)), D(experiments, "rspackFuture", {}), D(experiments, "
|
|
5837
|
+
F(experiments, "cache", ()=>development), D(experiments, "futureDefaults", !1), D(experiments, "lazyCompilation", !1), D(experiments, "asyncWebAssembly", experiments.futureDefaults), D(experiments, "css", !!experiments.futureDefaults || void 0), D(experiments, "topLevelAwait", !0), D(experiments, "deferImport", !1), D(experiments, "buildHttp", void 0), experiments.buildHttp && "object" == typeof experiments.buildHttp && D(experiments.buildHttp, "upgrade", !1), D(experiments, "incremental", {}), "object" == typeof experiments.incremental && (D(experiments.incremental, "silent", !0), D(experiments.incremental, "make", !0), D(experiments.incremental, "inferAsyncModules", !0), D(experiments.incremental, "providedExports", !0), D(experiments.incremental, "dependenciesDiagnostics", !0), D(experiments.incremental, "sideEffects", !0), D(experiments.incremental, "buildChunkGraph", !1), D(experiments.incremental, "moduleIds", !0), D(experiments.incremental, "chunkIds", !0), D(experiments.incremental, "modulesHashes", !0), D(experiments.incremental, "modulesCodegen", !0), D(experiments.incremental, "modulesRuntimeRequirements", !0), D(experiments.incremental, "chunksRuntimeRequirements", !0), D(experiments.incremental, "chunksHashes", !0), D(experiments.incremental, "chunksRender", !0), D(experiments.incremental, "emitAssets", !0)), D(experiments, "rspackFuture", {}), D(experiments, "parallelLoader", !1), D(experiments, "useInputFileSystem", !1), D(experiments, "inlineConst", !0), D(experiments, "inlineEnum", !1), D(experiments, "typeReexportsPresence", !1), D(experiments, "lazyBarrel", !0);
|
|
5834
5838
|
}, applybundlerInfoDefaults = (rspackFuture, library)=>{
|
|
5835
|
-
"object" == typeof rspackFuture && (D(rspackFuture, "bundlerInfo", {}), "object" == typeof rspackFuture.bundlerInfo && (D(rspackFuture.bundlerInfo, "version", "1.7.0-beta.
|
|
5839
|
+
"object" == typeof rspackFuture && (D(rspackFuture, "bundlerInfo", {}), "object" == typeof rspackFuture.bundlerInfo && (D(rspackFuture.bundlerInfo, "version", "1.7.0-beta.1"), D(rspackFuture.bundlerInfo, "bundler", "rspack"), D(rspackFuture.bundlerInfo, "force", !library)));
|
|
5836
5840
|
}, applySnapshotDefaults = (_snapshot, _env)=>{}, applyModuleDefaults = (module1, { cache, asyncWebAssembly, css, targetProperties, mode, uniqueName, deferImport })=>{
|
|
5837
5841
|
if (assertNotNill(module1.parser), assertNotNill(module1.generator), cache ? D(module1, "unsafeCache", /[\\/]node_modules[\\/]/) : D(module1, "unsafeCache", !1), F(module1.parser, "asset", ()=>({})), assertNotNill(module1.parser.asset), F(module1.parser.asset, "dataUrlCondition", ()=>({})), "object" == typeof module1.parser.asset.dataUrlCondition && D(module1.parser.asset.dataUrlCondition, "maxSize", 8096), F(module1.parser, "javascript", ()=>({})), assertNotNill(module1.parser.javascript), ((parserOptions, { deferImport })=>{
|
|
5838
5842
|
D(parserOptions, "dynamicImportMode", "lazy"), D(parserOptions, "dynamicImportPrefetch", !1), D(parserOptions, "dynamicImportPreload", !1), D(parserOptions, "url", !0), D(parserOptions, "exprContextCritical", !0), D(parserOptions, "unknownContextCritical", !0), D(parserOptions, "wrappedContextCritical", !1), D(parserOptions, "wrappedContextRegExp", /.*/), D(parserOptions, "strictExportPresence", !1), D(parserOptions, "requireAsExpression", !0), D(parserOptions, "requireDynamic", !0), D(parserOptions, "requireResolve", !0), D(parserOptions, "commonjs", !0), D(parserOptions, "importDynamic", !0), D(parserOptions, "worker", [
|
|
@@ -6312,7 +6316,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
6312
6316
|
main: {}
|
|
6313
6317
|
} : "function" == typeof config.entry ? (fn = config.entry, ()=>Promise.resolve().then(fn).then(getNormalizedEntryStatic)) : getNormalizedEntryStatic(config.entry),
|
|
6314
6318
|
output: nestedConfig(config.output, (output)=>{
|
|
6315
|
-
"cssHeadDataCompression" in output &&
|
|
6319
|
+
"cssHeadDataCompression" in output && deprecate("cssHeadDataCompression is not used now, see https://github.com/web-infra-dev/rspack/pull/8534, this option could be removed in the future");
|
|
6316
6320
|
let { library } = output, libraryBase = "object" == typeof library && library && !Array.isArray(library) && "type" in library ? library : library || output.libraryTarget ? {
|
|
6317
6321
|
name: library
|
|
6318
6322
|
} : void 0;
|
|
@@ -6451,7 +6455,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
6451
6455
|
plugins: nestedArray(config.plugins, (p)=>[
|
|
6452
6456
|
...p
|
|
6453
6457
|
]),
|
|
6454
|
-
experiments: nestedConfig(config.experiments, (experiments)=>(experiments.layers &&
|
|
6458
|
+
experiments: nestedConfig(config.experiments, (experiments)=>(experiments.layers && deprecate("`experiments.layers` config is deprecated and will be removed in Rspack v2.0. Feature layers will always be enabled. Remove this option from your Rspack configuration."), !1 === experiments.topLevelAwait && deprecate("`experiments.topLevelAwait` config is deprecated and will be removed in Rspack v2.0. Top-level await will always be enabled. Remove this option from your Rspack configuration."), experiments.lazyBarrel && deprecate("`experiments.lazyBarrel` config is deprecated and will be removed in Rspack v2.0. Lazy barrel is already stable and enabled by default. Remove this option from your Rspack configuration."), experiments.inlineConst && deprecate("`experiments.inlineConst` config is deprecated and will be removed in Rspack v2.0. Inline Const is already stable and enabled by default. Remove this option from your Rspack configuration."), experiments.inlineEnum && deprecate("`experiments.inlineEnum` config is deprecated and will be removed in Rspack v2.0. Inline Enum is already stable. Remove this option from your Rspack configuration."), experiments.typeReexportsPresence && deprecate("`experiments.typeReexportsPresence` config is deprecated and will be removed in Rspack v2.0. typeReexportsPresence is already stable. Remove this option from your Rspack configuration."), {
|
|
6455
6459
|
...experiments,
|
|
6456
6460
|
cache: optionalNestedConfig(experiments.cache, (cache)=>{
|
|
6457
6461
|
if ("boolean" == typeof cache || "memory" === cache.type) return cache;
|
|
@@ -6470,7 +6474,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
6470
6474
|
managedPaths: optionalNestedArray(snapshot.managedPaths, (p)=>[
|
|
6471
6475
|
...p
|
|
6472
6476
|
]) || [
|
|
6473
|
-
|
|
6477
|
+
/[\\/]node_modules[\\/][^.]/
|
|
6474
6478
|
]
|
|
6475
6479
|
},
|
|
6476
6480
|
storage: {
|
|
@@ -6481,7 +6485,6 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
6481
6485
|
}),
|
|
6482
6486
|
lazyCompilation: optionalNestedConfig(experiments.lazyCompilation, (options)=>!0 === options ? {} : options),
|
|
6483
6487
|
incremental: optionalNestedConfig(experiments.incremental, (options)=>getNormalizedIncrementalOptions(options)),
|
|
6484
|
-
parallelCodeSplitting: experiments.parallelCodeSplitting,
|
|
6485
6488
|
buildHttp: experiments.buildHttp,
|
|
6486
6489
|
parallelLoader: experiments.parallelLoader,
|
|
6487
6490
|
useInputFileSystem: experiments.useInputFileSystem
|
|
@@ -7599,7 +7602,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
7599
7602
|
});
|
|
7600
7603
|
}
|
|
7601
7604
|
}
|
|
7602
|
-
let CORE_VERSION = "1.7.0-beta.
|
|
7605
|
+
let CORE_VERSION = "1.7.0-beta.1", bindingVersionCheck_errorMessage = (coreVersion, expectedCoreVersion)=>process.env.RSPACK_BINDING ? `Unmatched version @rspack/core@${coreVersion} and binding version.
|
|
7603
7606
|
|
|
7604
7607
|
Help:
|
|
7605
7608
|
Looks like you are using a custom binding (via environment variable 'RSPACK_BINDING=${process.env.RSPACK_BINDING}').
|
|
@@ -8908,7 +8911,7 @@ Help:
|
|
|
8908
8911
|
obj.children = this.stats.map((stat, idx)=>{
|
|
8909
8912
|
let obj = stat.toJson(childOptions.children[idx]), compilationName = stat.compilation.name;
|
|
8910
8913
|
return obj.name = compilationName && makePathsRelative(childOptions.context, compilationName, stat.compilation.compiler.root), obj;
|
|
8911
|
-
}), childOptions.version && (obj.rspackVersion = "1.7.0-beta.
|
|
8914
|
+
}), childOptions.version && (obj.rspackVersion = "1.7.0-beta.1", obj.version = "5.75.0"), childOptions.hash && (obj.hash = obj.children.map((j)=>j.hash).join(""));
|
|
8912
8915
|
let mapError = (j, obj)=>({
|
|
8913
8916
|
...obj,
|
|
8914
8917
|
compilerPath: obj.compilerPath ? `${j.name}.${obj.compilerPath}` : j.name
|
|
@@ -9818,7 +9821,7 @@ Help:
|
|
|
9818
9821
|
object.hash = context.getStatsCompilation(compilation).hash;
|
|
9819
9822
|
},
|
|
9820
9823
|
version: (object)=>{
|
|
9821
|
-
object.version = "5.75.0", object.rspackVersion = "1.7.0-beta.
|
|
9824
|
+
object.version = "5.75.0", object.rspackVersion = "1.7.0-beta.1";
|
|
9822
9825
|
},
|
|
9823
9826
|
env: (object, _compilation, _context, { _env })=>{
|
|
9824
9827
|
object.env = _env;
|
|
@@ -11384,7 +11387,7 @@ Help:
|
|
|
11384
11387
|
});
|
|
11385
11388
|
}
|
|
11386
11389
|
}
|
|
11387
|
-
var CachedInputFileSystem = __webpack_require__("../../node_modules/.pnpm/enhanced-resolve@5.18.
|
|
11390
|
+
var CachedInputFileSystem = __webpack_require__("../../node_modules/.pnpm/enhanced-resolve@5.18.4/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js"), CachedInputFileSystem_default = __webpack_require__.n(CachedInputFileSystem);
|
|
11388
11391
|
let filterToFunction = (item)=>{
|
|
11389
11392
|
if ("string" == typeof item) {
|
|
11390
11393
|
let regExp = RegExp(`[\\\\/]${item.replace(/[-[\]{}()*+?.\\^$|]/g, "\\$&")}([\\\\/]|$|!|\\?)`);
|
|
@@ -12037,7 +12040,7 @@ Help:
|
|
|
12037
12040
|
let _options = JSON.stringify(options || {});
|
|
12038
12041
|
return binding_default().transform(source, _options);
|
|
12039
12042
|
}
|
|
12040
|
-
let exports_rspackVersion = "1.7.0-beta.
|
|
12043
|
+
let exports_rspackVersion = "1.7.0-beta.1", exports_version = "5.75.0", exports_WebpackError = Error, sources = __webpack_require__("webpack-sources"), exports_config = {
|
|
12041
12044
|
getNormalizedRspackOptions: getNormalizedRspackOptions,
|
|
12042
12045
|
applyRspackOptionsDefaults: applyRspackOptionsDefaults,
|
|
12043
12046
|
getNormalizedWebpackOptions: getNormalizedRspackOptions,
|
|
@@ -12351,7 +12354,7 @@ Help:
|
|
|
12351
12354
|
}
|
|
12352
12355
|
{
|
|
12353
12356
|
let { compiler, watch } = create();
|
|
12354
|
-
return watch &&
|
|
12357
|
+
return watch && deprecate("A 'callback' argument needs to be provided to the 'rspack(options, callback)' function when the 'watch' option is set. There is no way to handle the 'watch' option without a callback."), compiler;
|
|
12355
12358
|
}
|
|
12356
12359
|
}, exports_namespaceObject);
|
|
12357
12360
|
src_fn.rspack = src_fn, src_fn.webpack = src_fn;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __module_federation_bundler_runtime__,__module_federation_runtime_plugins__,__module_federation_remote_infos__,__module_federation_container_name__,__module_federation_share_strategy__;module.exports=function(){if((__webpack_require__.initializeSharingData||__webpack_require__.initializeExposesData)&&__webpack_require__.federation){var __webpack_require___remotesLoadingData,__webpack_require___remotesLoadingData1,__webpack_require___initializeSharingData,__webpack_require___consumesLoadingData,__webpack_require___consumesLoadingData1,__webpack_require___initializeExposesData,__webpack_require___consumesLoadingData2;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)){var _obj,_key;var _;(_=(_obj=obj)[_key=key])!==null&&_!==void 0?_:_obj[_key]=[];obj[key].push(...value)}else if(typeof value==="object"&&value!==null){var _obj1,_key1;var _1;(_1=(_obj1=obj)[_key1=key])!==null&&_1!==void 0?_1:_obj1[_key1]={};Object.assign(obj[key],value)}};const early=(obj,key,initial)=>{var _obj,_key;var _;(_=(_obj=obj)[_key=key])!==null&&_!==void 0?_:_obj[_key]=initial()};var
|
|
1
|
+
var __module_federation_bundler_runtime__,__module_federation_runtime_plugins__,__module_federation_remote_infos__,__module_federation_container_name__,__module_federation_share_strategy__;module.exports=function(){if((__webpack_require__.initializeSharingData||__webpack_require__.initializeExposesData)&&__webpack_require__.federation){var __webpack_require___remotesLoadingData,__webpack_require___remotesLoadingData1,__webpack_require___initializeSharingData,__webpack_require___consumesLoadingData,__webpack_require___consumesLoadingData1,__webpack_require___initializeExposesData,__webpack_require___consumesLoadingData2;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)){var _obj,_key;var _;(_=(_obj=obj)[_key=key])!==null&&_!==void 0?_:_obj[_key]=[];obj[key].push(...value)}else if(typeof value==="object"&&value!==null){var _obj1,_key1;var _1;(_1=(_obj1=obj)[_key1=key])!==null&&_1!==void 0?_1:_obj1[_key1]={};Object.assign(obj[key],value)}};const early=(obj,key,initial)=>{var _obj,_key;var _;(_=(_obj=obj)[_key=key])!==null&&_!==void 0?_:_obj[_key]=initial()};var _ref;const remotesLoadingChunkMapping=(_ref=(__webpack_require___remotesLoadingData=__webpack_require__.remotesLoadingData)===null||__webpack_require___remotesLoadingData===void 0?void 0:__webpack_require___remotesLoadingData.chunkMapping)!==null&&_ref!==void 0?_ref:{};var _ref1;const remotesLoadingModuleIdToRemoteDataMapping=(_ref1=(__webpack_require___remotesLoadingData1=__webpack_require__.remotesLoadingData)===null||__webpack_require___remotesLoadingData1===void 0?void 0:__webpack_require___remotesLoadingData1.moduleIdToRemoteDataMapping)!==null&&_ref1!==void 0?_ref1:{};var _ref2;const initializeSharingScopeToInitDataMapping=(_ref2=(__webpack_require___initializeSharingData=__webpack_require__.initializeSharingData)===null||__webpack_require___initializeSharingData===void 0?void 0:__webpack_require___initializeSharingData.scopeToSharingDataMapping)!==null&&_ref2!==void 0?_ref2:{};var _ref3;const consumesLoadingChunkMapping=(_ref3=(__webpack_require___consumesLoadingData=__webpack_require__.consumesLoadingData)===null||__webpack_require___consumesLoadingData===void 0?void 0:__webpack_require___consumesLoadingData.chunkMapping)!==null&&_ref3!==void 0?_ref3:{};var _ref4;const consumesLoadingModuleToConsumeDataMapping=(_ref4=(__webpack_require___consumesLoadingData1=__webpack_require__.consumesLoadingData)===null||__webpack_require___consumesLoadingData1===void 0?void 0:__webpack_require___consumesLoadingData1.moduleIdToConsumeDataMapping)!==null&&_ref4!==void 0?_ref4:{};const consumesLoadinginstalledModules={};const initializeSharingInitPromises=[];const initializeSharingInitTokens={};const containerShareScope=(__webpack_require___initializeExposesData=__webpack_require__.initializeExposesData)===null||__webpack_require___initializeExposesData===void 0?void 0:__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,"shareStrategy",()=>__module_federation_share_strategy__);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,version,factory,eager,singleton,requiredVersion,strictVersion}=stage;const shareConfig={};const isValidValue=function(val){return typeof val!=="undefined"};if(isValidValue(singleton)){shareConfig.singleton=singleton}if(isValidValue(requiredVersion)){shareConfig.requiredVersion=requiredVersion}if(isValidValue(eager)){shareConfig.eager=eager}if(isValidValue(strictVersion)){shareConfig.strictVersion=strictVersion}const options={version,scope:[scope],shareConfig,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,"remoteInfos",()=>__module_federation_remote_infos__);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,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,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,initPromises:initializeSharingInitPromises,initTokens:initializeSharingInitTokens,webpackRequire:__webpack_require__}));override(__webpack_require__,"initContainer",(shareScope,initScope,remoteEntryInitOptions)=>__webpack_require__.federation.bundlerRuntime.initContainerEntry({shareScope,initScope,remoteEntryInitOptions,shareScopeKey:containerShareScope,webpackRequire:__webpack_require__}));override(__webpack_require__,"getContainer",(module1,getScope)=>{var moduleMap=__webpack_require__.initializeExposesData.moduleMap;__webpack_require__.R=getScope;getScope=Object.prototype.hasOwnProperty.call(moduleMap,module1)?moduleMap[module1]():Promise.resolve().then(()=>{throw new Error('Module "'+module1+'" 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___consumesLoadingData2=__webpack_require__.consumesLoadingData)===null||__webpack_require___consumesLoadingData2===void 0?void 0:__webpack_require___consumesLoadingData2.initialConsumes){__webpack_require__.federation.bundlerRuntime.installInitialConsumes({webpackRequire:__webpack_require__,installedModules:consumesLoadinginstalledModules,initialConsumes:__webpack_require__.consumesLoadingData.initialConsumes,moduleToHandlerMapping:__webpack_require__.federation.consumesLoadingModuleToHandlerMapping})}}};
|
package/dist/rspack.d.ts
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The following code is modified based on
|
|
3
|
+
* https://github.com/webpack/webpack/blob/4b4ca3b/lib
|
|
4
|
+
*
|
|
5
|
+
* MIT Licensed
|
|
6
|
+
* Author Tobias Koppers @sokra
|
|
7
|
+
* Copyright (c) JS Foundation and other contributors
|
|
8
|
+
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
|
+
*/
|
|
1
10
|
import type { Callback } from "@rspack/lite-tapable";
|
|
2
11
|
import { Compiler } from "./Compiler";
|
|
3
12
|
import { type RspackOptions } from "./config";
|
package/dist/util/index.d.ts
CHANGED
|
@@ -6,3 +6,4 @@ export declare function serializeObject(map: string | object | undefined | null)
|
|
|
6
6
|
export declare function indent(str: string, prefix: string): string;
|
|
7
7
|
export declare function stringifyLoaderObject(o: LoaderObject): string;
|
|
8
8
|
export declare const unsupported: (name: string, issue?: string) => never;
|
|
9
|
+
export declare function deprecate(message: string): void;
|
package/dist/worker.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __webpack_modules__ = {
|
|
3
|
-
"./src/swc.ts" (
|
|
3
|
+
"./src/swc.ts" (__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
4
4
|
__webpack_require__.r(__webpack_exports__), __webpack_require__.d(__webpack_exports__, {
|
|
5
5
|
minify: ()=>minify,
|
|
6
6
|
minifySync: ()=>minifySync,
|
|
@@ -25,7 +25,7 @@ var __webpack_modules__ = {
|
|
|
25
25
|
return _rspack_binding__rspack_import_0_default().transformSync(source, _options);
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
|
-
"./src/util/cleverMerge.ts" (
|
|
28
|
+
"./src/util/cleverMerge.ts" (__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
29
29
|
__webpack_require__.d(__webpack_exports__, {
|
|
30
30
|
ks: ()=>cleverMerge
|
|
31
31
|
});
|
|
@@ -203,7 +203,7 @@ var __webpack_modules__ = {
|
|
|
203
203
|
}
|
|
204
204
|
};
|
|
205
205
|
},
|
|
206
|
-
"./src/util/createHash.ts" (
|
|
206
|
+
"./src/util/createHash.ts" (__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
207
207
|
let createMd4, createXxhash64;
|
|
208
208
|
__webpack_require__.d(__webpack_exports__, {
|
|
209
209
|
n: ()=>createHash_createHash
|
|
@@ -454,7 +454,7 @@ __webpack_require__.n = (module)=>{
|
|
|
454
454
|
get: definition[key]
|
|
455
455
|
});
|
|
456
456
|
}, __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop), __webpack_require__.r = (exports1)=>{
|
|
457
|
-
|
|
457
|
+
"u" > typeof Symbol && Symbol.toStringTag && Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
458
458
|
value: 'Module'
|
|
459
459
|
}), Object.defineProperty(exports1, '__esModule', {
|
|
460
460
|
value: !0
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspack/core",
|
|
3
|
-
"version": "1.7.0-beta.
|
|
3
|
+
"version": "1.7.0-beta.1",
|
|
4
4
|
"webpackVersion": "5.75.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "The fast Rust-based web bundler with webpack-compatible API",
|
|
@@ -37,15 +37,15 @@
|
|
|
37
37
|
"directory": "packages/rspack"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@ast-grep/napi": "^0.40.
|
|
40
|
+
"@ast-grep/napi": "^0.40.3",
|
|
41
41
|
"@napi-rs/wasm-runtime": "1.0.7",
|
|
42
42
|
"@rsbuild/plugin-node-polyfill": "^1.4.2",
|
|
43
|
-
"@rslib/core": "0.18.
|
|
43
|
+
"@rslib/core": "0.18.5",
|
|
44
44
|
"@swc/types": "0.1.25",
|
|
45
|
-
"@types/node": "^20.19.
|
|
45
|
+
"@types/node": "^20.19.27",
|
|
46
46
|
"@types/watchpack": "^2.4.5",
|
|
47
47
|
"browserslist-load-config": "^1.0.1",
|
|
48
|
-
"enhanced-resolve": "5.18.
|
|
48
|
+
"enhanced-resolve": "5.18.4",
|
|
49
49
|
"glob-to-regexp": "^0.4.1",
|
|
50
50
|
"memfs": "4.51.1",
|
|
51
51
|
"prebundle": "^1.6.0",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"@module-federation/runtime-tools": "0.21.6",
|
|
60
60
|
"@rspack/lite-tapable": "1.1.0",
|
|
61
|
-
"@rspack/binding": "1.7.0-beta.
|
|
61
|
+
"@rspack/binding": "1.7.0-beta.1"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
64
|
"@swc/helpers": ">=0.5.1"
|