@rspack/core 1.5.0-rc.0 → 1.5.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/Compiler.d.ts +5 -0
- package/dist/MultiWatching.d.ts +1 -1
- package/dist/builtin-plugin/ExternalsPlugin.d.ts +2 -1
- package/dist/builtin-plugin/lazy-compilation/lazyCompilation.d.ts +2 -16
- package/dist/config/adapterRuleUse.d.ts +26 -2
- package/dist/index.js +202 -178
- package/dist/schema/loaders.d.ts +1 -0
- package/dist/worker.js +1 -3
- package/hot/lazy-compilation-node.js +1 -3
- package/hot/lazy-compilation-web.js +4 -3
- package/package.json +2 -2
- package/dist/util/require.d.ts +0 -3
package/dist/Compiler.d.ts
CHANGED
@@ -94,6 +94,11 @@ declare class Compiler {
|
|
94
94
|
cache: Cache;
|
95
95
|
compilerPath: string;
|
96
96
|
options: RspackOptionsNormalized;
|
97
|
+
/**
|
98
|
+
* Note: This is not a webpack public API, maybe removed in future.
|
99
|
+
* @internal
|
100
|
+
*/
|
101
|
+
__internal_browser_require: (id: string) => unknown;
|
97
102
|
constructor(context: string, options: RspackOptionsNormalized);
|
98
103
|
get recordsInputPath(): never;
|
99
104
|
get recordsOutputPath(): never;
|
package/dist/MultiWatching.d.ts
CHANGED
@@ -18,7 +18,7 @@ declare class MultiWatching {
|
|
18
18
|
* @param compiler - the compiler
|
19
19
|
*/
|
20
20
|
constructor(watchings: Watching[], compiler: MultiCompiler);
|
21
|
-
invalidate(callback
|
21
|
+
invalidate(callback?: Callback<Error, void>): void;
|
22
22
|
invalidateWithChangesAndRemovals(changedFiles?: Set<string>, removedFiles?: Set<string>, callback?: Callback<Error, void>): void;
|
23
23
|
close(callback: Callback<Error, void>): void;
|
24
24
|
suspend(): void;
|
@@ -5,7 +5,8 @@ export declare class ExternalsPlugin extends RspackBuiltinPlugin {
|
|
5
5
|
#private;
|
6
6
|
private type;
|
7
7
|
private externals;
|
8
|
+
private placeInInitial?;
|
8
9
|
name: BuiltinPluginName;
|
9
|
-
constructor(type: string, externals: Externals);
|
10
|
+
constructor(type: string, externals: Externals, placeInInitial?: boolean | undefined);
|
10
11
|
raw(): BuiltinPlugin | undefined;
|
11
12
|
}
|
@@ -1,22 +1,8 @@
|
|
1
1
|
import type { Module } from "../../Module";
|
2
2
|
export declare const BuiltinLazyCompilationPlugin: {
|
3
|
-
new (
|
4
|
-
module: string;
|
5
|
-
path: string;
|
6
|
-
}) => {
|
7
|
-
active: boolean;
|
8
|
-
data: string;
|
9
|
-
client: string;
|
10
|
-
}, cacheable: boolean, entries: boolean, imports: boolean, test?: RegExp | ((module: Module) => boolean) | undefined): {
|
3
|
+
new (currentActiveModules: () => Set<string>, entries: boolean, imports: boolean, client: string, test?: RegExp | ((module: Module) => boolean) | undefined): {
|
11
4
|
name: string;
|
12
|
-
_args: [
|
13
|
-
module: string;
|
14
|
-
path: string;
|
15
|
-
}) => {
|
16
|
-
active: boolean;
|
17
|
-
data: string;
|
18
|
-
client: string;
|
19
|
-
}, cacheable: boolean, entries: boolean, imports: boolean, test?: RegExp | ((module: Module) => boolean) | undefined];
|
5
|
+
_args: [currentActiveModules: () => Set<string>, entries: boolean, imports: boolean, client: string, test?: RegExp | ((module: Module) => boolean) | undefined];
|
20
6
|
affectedHooks: "done" | "compilation" | "run" | "afterDone" | "thisCompilation" | "invalid" | "compile" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "emit" | "assetEmitted" | "afterEmit" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "make" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | "additionalPass" | undefined;
|
21
7
|
raw(compiler: import("../..").Compiler): import("@rspack/binding").BuiltinPlugin;
|
22
8
|
apply(compiler: import("../..").Compiler): void;
|
@@ -322,8 +322,32 @@ export interface LoaderContext<OptionsType = {}> {
|
|
322
322
|
*/
|
323
323
|
__internal__setParseMeta: (key: string, value: string) => void;
|
324
324
|
}
|
325
|
-
export type LoaderDefinitionFunction<OptionsType = {}, ContextAdditions = {}> = (this: LoaderContext<OptionsType> & ContextAdditions, content: string, sourceMap?: string | SourceMap, additionalData?: AdditionalData) => string | void | Buffer | Promise<string | Buffer>;
|
326
|
-
export type PitchLoaderDefinitionFunction<OptionsType = {}, ContextAdditions = {}> = (this: LoaderContext<OptionsType> & ContextAdditions, remainingRequest: string, previousRequest: string, data: object) => string | void | Buffer | Promise<string | Buffer>;
|
325
|
+
export type LoaderDefinitionFunction<OptionsType = {}, ContextAdditions = {}> = (this: LoaderContext<OptionsType> & ContextAdditions, content: string, sourceMap?: string | SourceMap, additionalData?: AdditionalData) => string | void | Buffer | Promise<string | Buffer | void>;
|
326
|
+
export type PitchLoaderDefinitionFunction<OptionsType = {}, ContextAdditions = {}> = (this: LoaderContext<OptionsType> & ContextAdditions, remainingRequest: string, previousRequest: string, data: object) => string | void | Buffer | Promise<string | Buffer | void>;
|
327
|
+
/**
|
328
|
+
* Defines a loader for Rspack.
|
329
|
+
* A loader is a transformer that converts various types of modules into Rspack
|
330
|
+
* supported types. By using different kinds of loaders, you can extend Rspack to
|
331
|
+
* process additional module types, including JSX, Markdown, Sass, Less, and more.
|
332
|
+
*
|
333
|
+
* @template OptionsType - The type of options that the loader accepts
|
334
|
+
* @template ContextAdditions - Additional properties to add to the loader context
|
335
|
+
*
|
336
|
+
* @example
|
337
|
+
* ```ts
|
338
|
+
* import type { LoaderDefinition } from '@rspack/core';
|
339
|
+
*
|
340
|
+
* type MyLoaderOptions = {
|
341
|
+
* foo: string;
|
342
|
+
* };
|
343
|
+
*
|
344
|
+
* const myLoader: LoaderDefinition<MyLoaderOptions> = function(source) {
|
345
|
+
* return someOperation(source);
|
346
|
+
* };
|
347
|
+
*
|
348
|
+
* export default myLoader;
|
349
|
+
* ```
|
350
|
+
*/
|
327
351
|
export type LoaderDefinition<OptionsType = {}, ContextAdditions = {}> = LoaderDefinitionFunction<OptionsType, ContextAdditions> & {
|
328
352
|
raw?: false;
|
329
353
|
pitch?: PitchLoaderDefinitionFunction;
|
package/dist/index.js
CHANGED
@@ -207,6 +207,77 @@ var __webpack_modules__ = {
|
|
207
207
|
}
|
208
208
|
};
|
209
209
|
},
|
210
|
+
"./src/builtin-plugin/base.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
211
|
+
__webpack_require__.d(__webpack_exports__, {
|
212
|
+
Gp: ()=>canInherentFromParent,
|
213
|
+
Xj: ()=>RspackBuiltinPlugin,
|
214
|
+
dE: ()=>createNativePlugin,
|
215
|
+
no: ()=>createBuiltinPlugin,
|
216
|
+
vt: ()=>create
|
217
|
+
});
|
218
|
+
var _rspack_binding__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("@rspack/binding"), _rspack_binding__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(_rspack_binding__WEBPACK_IMPORTED_MODULE_0__);
|
219
|
+
let HOOKS_CAN_NOT_INHERENT_FROM_PARENT = [
|
220
|
+
"make",
|
221
|
+
"compile",
|
222
|
+
"emit",
|
223
|
+
"afterEmit",
|
224
|
+
"invalid",
|
225
|
+
"done",
|
226
|
+
"thisCompilation"
|
227
|
+
];
|
228
|
+
function canInherentFromParent(affectedHooks) {
|
229
|
+
return void 0 !== affectedHooks && !HOOKS_CAN_NOT_INHERENT_FROM_PARENT.includes(affectedHooks);
|
230
|
+
}
|
231
|
+
class RspackBuiltinPlugin {
|
232
|
+
affectedHooks;
|
233
|
+
apply(compiler) {
|
234
|
+
let raw = this.raw(compiler);
|
235
|
+
raw && (raw.canInherentFromParent = canInherentFromParent(this.affectedHooks), compiler.__internal__registerBuiltinPlugin(raw));
|
236
|
+
}
|
237
|
+
}
|
238
|
+
function createBuiltinPlugin(name, options) {
|
239
|
+
return {
|
240
|
+
name: name,
|
241
|
+
options: options ?? !1
|
242
|
+
};
|
243
|
+
}
|
244
|
+
function create(name, resolve, affectedHooks) {
|
245
|
+
class Plugin extends RspackBuiltinPlugin {
|
246
|
+
name = name;
|
247
|
+
_args;
|
248
|
+
affectedHooks = affectedHooks;
|
249
|
+
constructor(...args){
|
250
|
+
super(), this._args = args;
|
251
|
+
}
|
252
|
+
raw(compiler) {
|
253
|
+
return createBuiltinPlugin(name, resolve.apply(compiler, this._args));
|
254
|
+
}
|
255
|
+
}
|
256
|
+
return Object.defineProperty(Plugin, "name", {
|
257
|
+
value: name
|
258
|
+
}), Plugin;
|
259
|
+
}
|
260
|
+
let INTERNAL_PLUGIN_NAMES = Object.keys(_rspack_binding__WEBPACK_IMPORTED_MODULE_0___default().BuiltinPluginName);
|
261
|
+
function createNativePlugin(name, resolve, affectedHooks) {
|
262
|
+
if (INTERNAL_PLUGIN_NAMES.includes(name)) throw Error(`Cannot register native plugin with name '${name}', it conflicts with internal plugin names.`);
|
263
|
+
return create(name, resolve, affectedHooks);
|
264
|
+
}
|
265
|
+
},
|
266
|
+
"./src/builtin-plugin/lazy-compilation/lazyCompilation.ts": function(module, __webpack_exports__, __webpack_require__) {
|
267
|
+
__webpack_require__.d(__webpack_exports__, {
|
268
|
+
a: ()=>BuiltinLazyCompilationPlugin
|
269
|
+
});
|
270
|
+
var _rspack_binding__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("@rspack/binding"), _base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./src/builtin-plugin/base.ts");
|
271
|
+
module = __webpack_require__.hmd(module);
|
272
|
+
let BuiltinLazyCompilationPlugin = (0, _base__WEBPACK_IMPORTED_MODULE_1__.vt)(_rspack_binding__WEBPACK_IMPORTED_MODULE_0__.BuiltinPluginName.LazyCompilationPlugin, (currentActiveModules, entries, imports, client, test)=>({
|
273
|
+
module,
|
274
|
+
imports,
|
275
|
+
entries,
|
276
|
+
test,
|
277
|
+
client,
|
278
|
+
currentActiveModules
|
279
|
+
}), "thisCompilation");
|
280
|
+
},
|
210
281
|
"browserslist-load-config": function(module) {
|
211
282
|
module.exports = require("../compiled/browserslist-load-config/index.js");
|
212
283
|
},
|
@@ -258,9 +329,11 @@ function __webpack_require__(moduleId) {
|
|
258
329
|
var cachedModule = __webpack_module_cache__[moduleId];
|
259
330
|
if (void 0 !== cachedModule) return cachedModule.exports;
|
260
331
|
var module = __webpack_module_cache__[moduleId] = {
|
332
|
+
id: moduleId,
|
333
|
+
loaded: !1,
|
261
334
|
exports: {}
|
262
335
|
};
|
263
|
-
return __webpack_modules__[moduleId](module, module.exports, __webpack_require__), module.exports;
|
336
|
+
return __webpack_modules__[moduleId](module, module.exports, __webpack_require__), module.loaded = !0, module.exports;
|
264
337
|
}
|
265
338
|
__webpack_require__.n = (module)=>{
|
266
339
|
var getter = module && module.__esModule ? ()=>module.default : ()=>module;
|
@@ -272,7 +345,12 @@ __webpack_require__.n = (module)=>{
|
|
272
345
|
enumerable: !0,
|
273
346
|
get: definition[key]
|
274
347
|
});
|
275
|
-
}, __webpack_require__.
|
348
|
+
}, __webpack_require__.hmd = (module)=>((module = Object.create(module)).children || (module.children = []), Object.defineProperty(module, 'exports', {
|
349
|
+
enumerable: !0,
|
350
|
+
set: ()=>{
|
351
|
+
throw Error('ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: ' + module.id);
|
352
|
+
}
|
353
|
+
}), module), __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop), __webpack_require__.r = (exports1)=>{
|
276
354
|
'undefined' != typeof Symbol && Symbol.toStringTag && Object.defineProperty(exports1, Symbol.toStringTag, {
|
277
355
|
value: 'Module'
|
278
356
|
}), Object.defineProperty(exports1, '__esModule', {
|
@@ -1955,48 +2033,8 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
1955
2033
|
return this.#data.keys()[Symbol.iterator]();
|
1956
2034
|
}
|
1957
2035
|
}
|
1958
|
-
|
1959
|
-
|
1960
|
-
"compile",
|
1961
|
-
"emit",
|
1962
|
-
"afterEmit",
|
1963
|
-
"invalid",
|
1964
|
-
"done",
|
1965
|
-
"thisCompilation"
|
1966
|
-
];
|
1967
|
-
function canInherentFromParent(affectedHooks) {
|
1968
|
-
return void 0 !== affectedHooks && !HOOKS_CAN_NOT_INHERENT_FROM_PARENT.includes(affectedHooks);
|
1969
|
-
}
|
1970
|
-
class RspackBuiltinPlugin {
|
1971
|
-
affectedHooks;
|
1972
|
-
apply(compiler) {
|
1973
|
-
let raw = this.raw(compiler);
|
1974
|
-
raw && (raw.canInherentFromParent = canInherentFromParent(this.affectedHooks), compiler.__internal__registerBuiltinPlugin(raw));
|
1975
|
-
}
|
1976
|
-
}
|
1977
|
-
function createBuiltinPlugin(name, options) {
|
1978
|
-
return {
|
1979
|
-
name: name,
|
1980
|
-
options: options ?? !1
|
1981
|
-
};
|
1982
|
-
}
|
1983
|
-
function base_create(name, resolve, affectedHooks) {
|
1984
|
-
class Plugin extends RspackBuiltinPlugin {
|
1985
|
-
name = name;
|
1986
|
-
_args;
|
1987
|
-
affectedHooks = affectedHooks;
|
1988
|
-
constructor(...args){
|
1989
|
-
super(), this._args = args;
|
1990
|
-
}
|
1991
|
-
raw(compiler) {
|
1992
|
-
return createBuiltinPlugin(name, resolve.apply(compiler, this._args));
|
1993
|
-
}
|
1994
|
-
}
|
1995
|
-
return Object.defineProperty(Plugin, "name", {
|
1996
|
-
value: name
|
1997
|
-
}), Plugin;
|
1998
|
-
}
|
1999
|
-
let INTERNAL_PLUGIN_NAMES = Object.keys(binding_default().BuiltinPluginName), APIPlugin = base_create(binding_.BuiltinPluginName.APIPlugin, ()=>{}), ArrayPushCallbackChunkFormatPlugin = base_create(binding_.BuiltinPluginName.ArrayPushCallbackChunkFormatPlugin, ()=>{}), AssetModulesPlugin = base_create(binding_.BuiltinPluginName.AssetModulesPlugin, ()=>{}, "compilation"), AsyncWebAssemblyModulesPlugin = base_create(binding_.BuiltinPluginName.AsyncWebAssemblyModulesPlugin, ()=>{}, "compilation"), BannerPlugin = base_create(binding_.BuiltinPluginName.BannerPlugin, (args)=>"string" == typeof args || "function" == typeof args ? {
|
2036
|
+
var builtin_plugin_base = __webpack_require__("./src/builtin-plugin/base.ts");
|
2037
|
+
let APIPlugin = (0, builtin_plugin_base.vt)(binding_.BuiltinPluginName.APIPlugin, ()=>{}), ArrayPushCallbackChunkFormatPlugin = (0, builtin_plugin_base.vt)(binding_.BuiltinPluginName.ArrayPushCallbackChunkFormatPlugin, ()=>{}), AssetModulesPlugin = (0, builtin_plugin_base.vt)(binding_.BuiltinPluginName.AssetModulesPlugin, ()=>{}, "compilation"), AsyncWebAssemblyModulesPlugin = (0, builtin_plugin_base.vt)(binding_.BuiltinPluginName.AsyncWebAssemblyModulesPlugin, ()=>{}, "compilation"), BannerPlugin = (0, builtin_plugin_base.vt)(binding_.BuiltinPluginName.BannerPlugin, (args)=>"string" == typeof args || "function" == typeof args ? {
|
2000
2038
|
banner: args
|
2001
2039
|
} : {
|
2002
2040
|
banner: args.banner,
|
@@ -2007,12 +2045,12 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
2007
2045
|
stage: args.stage,
|
2008
2046
|
include: args.include,
|
2009
2047
|
exclude: args.exclude
|
2010
|
-
}), BundlerInfoRspackPlugin =
|
2048
|
+
}), BundlerInfoRspackPlugin = (0, builtin_plugin_base.vt)(binding_.BuiltinPluginName.BundlerInfoRspackPlugin, (options)=>({
|
2011
2049
|
version: options.version || "unknown",
|
2012
2050
|
bundler: options.bundler || "rspack",
|
2013
2051
|
force: options.force ?? !0
|
2014
|
-
})), ChunkPrefetchPreloadPlugin =
|
2015
|
-
class CircularDependencyRspackPlugin extends
|
2052
|
+
})), ChunkPrefetchPreloadPlugin = (0, builtin_plugin_base.vt)(binding_.BuiltinPluginName.ChunkPrefetchPreloadPlugin, ()=>{});
|
2053
|
+
class CircularDependencyRspackPlugin extends builtin_plugin_base.Xj {
|
2016
2054
|
name = binding_.BuiltinPluginName.CircularDependencyRspackPlugin;
|
2017
2055
|
_options;
|
2018
2056
|
constructor(options){
|
@@ -2041,15 +2079,15 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
2041
2079
|
this._options.onEnd(compilation);
|
2042
2080
|
} : void 0
|
2043
2081
|
};
|
2044
|
-
return
|
2082
|
+
return (0, builtin_plugin_base.no)(this.name, rawOptions);
|
2045
2083
|
}
|
2046
2084
|
}
|
2047
|
-
let CommonJsChunkFormatPlugin =
|
2085
|
+
let CommonJsChunkFormatPlugin = (0, builtin_plugin_base.vt)(binding_.BuiltinPluginName.CommonJsChunkFormatPlugin, ()=>{}), ContextReplacementPlugin = (0, builtin_plugin_base.vt)(binding_.BuiltinPluginName.ContextReplacementPlugin, (resourceRegExp, newContentResource, newContentRecursive, newContentRegExp)=>{
|
2048
2086
|
let rawOptions = {
|
2049
2087
|
resourceRegExp
|
2050
2088
|
};
|
2051
2089
|
return "function" == typeof newContentResource || ("string" == typeof newContentResource && "object" == typeof newContentRecursive ? (rawOptions.newContentResource = newContentResource, rawOptions.newContentCreateContextMap = newContentRecursive) : "string" == typeof newContentResource && "function" == typeof newContentRecursive ? rawOptions.newContentResource = newContentResource : ("string" != typeof newContentResource && (newContentRegExp = newContentRecursive, newContentRecursive = newContentResource, newContentResource = void 0), "boolean" != typeof newContentRecursive && (newContentRegExp = newContentRecursive, newContentRecursive = void 0), rawOptions.newContentResource = newContentResource, rawOptions.newContentRecursive = newContentRecursive, rawOptions.newContentRegExp = newContentRegExp)), rawOptions;
|
2052
|
-
}), CopyRspackPlugin =
|
2090
|
+
}), CopyRspackPlugin = (0, builtin_plugin_base.vt)(binding_.BuiltinPluginName.CopyRspackPlugin, (copy)=>{
|
2053
2091
|
let ret = {
|
2054
2092
|
patterns: []
|
2055
2093
|
};
|
@@ -2060,7 +2098,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
2060
2098
|
let originalTransform = pattern.transform;
|
2061
2099
|
return originalTransform && ("object" == typeof originalTransform ? pattern.transform = (input, absoluteFilename)=>Promise.resolve(originalTransform.transformer(input, absoluteFilename)) : pattern.transform = (input, absoluteFilename)=>Promise.resolve(originalTransform(input, absoluteFilename))), pattern;
|
2062
2100
|
}), ret;
|
2063
|
-
}), CssChunkingPlugin =
|
2101
|
+
}), CssChunkingPlugin = (0, builtin_plugin_base.vt)(binding_default().BuiltinPluginName.CssChunkingPlugin, function(options = {}) {
|
2064
2102
|
if (options.nextjs) return {
|
2065
2103
|
strict: options.strict,
|
2066
2104
|
minSize: options.minSize,
|
@@ -2075,7 +2113,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
2075
2113
|
cssIndex && splitChunks.defaultSizeTypes.splice(cssIndex, 1);
|
2076
2114
|
}
|
2077
2115
|
return options;
|
2078
|
-
}), CssModulesPlugin =
|
2116
|
+
}), CssModulesPlugin = (0, builtin_plugin_base.vt)(binding_.BuiltinPluginName.CssModulesPlugin, ()=>{}, "compilation"), external_node_path_namespaceObject = require("node:path");
|
2079
2117
|
var external_node_path_default = __webpack_require__.n(external_node_path_namespaceObject);
|
2080
2118
|
let DEFAULT_FILENAME = "[name].css", LOADER_PATH = (0, external_node_path_namespaceObject.join)(__dirname, "cssExtractLoader.js");
|
2081
2119
|
class CssExtractRspackPlugin {
|
@@ -2117,7 +2155,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
2117
2155
|
};
|
2118
2156
|
}
|
2119
2157
|
}
|
2120
|
-
let DataUriPlugin =
|
2158
|
+
let DataUriPlugin = (0, builtin_plugin_base.vt)(binding_.BuiltinPluginName.DataUriPlugin, ()=>{}, "compilation"), DefinePlugin = (0, builtin_plugin_base.vt)(binding_.BuiltinPluginName.DefinePlugin, function(define) {
|
2121
2159
|
return normalizeValue(define, this.options.output.environment?.bigIntLiteral ?? !1);
|
2122
2160
|
}, "compilation"), normalizeValue = (define, supportsBigIntLiteral)=>{
|
2123
2161
|
let normalizePrimitive = (p)=>void 0 === p ? "undefined" : Object.is(p, -0) ? "-0" : p instanceof RegExp ? p.toString() : "function" == typeof p ? `(${p.toString()})` : "bigint" == typeof p ? supportsBigIntLiteral ? `${p}n` : `BigInt("${p}")` : p, normalizeObject = (define)=>Array.isArray(define) ? define.map(normalizeObject) : define instanceof RegExp ? normalizePrimitive(define) : define && "object" == typeof define ? Object.fromEntries(Object.keys(define).map((k)=>[
|
@@ -2126,25 +2164,25 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
2126
2164
|
])) : normalizePrimitive(define);
|
2127
2165
|
return normalizeObject(define);
|
2128
2166
|
};
|
2129
|
-
class DeterministicChunkIdsPlugin extends
|
2167
|
+
class DeterministicChunkIdsPlugin extends builtin_plugin_base.Xj {
|
2130
2168
|
name = binding_.BuiltinPluginName.DeterministicChunkIdsPlugin;
|
2131
2169
|
affectedHooks = "compilation";
|
2132
2170
|
raw(compiler) {
|
2133
|
-
return
|
2171
|
+
return (0, builtin_plugin_base.no)(this.name, void 0);
|
2134
2172
|
}
|
2135
2173
|
}
|
2136
|
-
class DeterministicModuleIdsPlugin extends
|
2174
|
+
class DeterministicModuleIdsPlugin extends builtin_plugin_base.Xj {
|
2137
2175
|
name = binding_.BuiltinPluginName.DeterministicModuleIdsPlugin;
|
2138
2176
|
affectedHooks = "compilation";
|
2139
2177
|
raw(compiler) {
|
2140
|
-
return
|
2178
|
+
return (0, builtin_plugin_base.no)(this.name, void 0);
|
2141
2179
|
}
|
2142
2180
|
}
|
2143
|
-
let DllEntryPlugin =
|
2181
|
+
let DllEntryPlugin = (0, builtin_plugin_base.vt)(binding_.BuiltinPluginName.DllEntryPlugin, (context, entries, options)=>({
|
2144
2182
|
context,
|
2145
2183
|
entries,
|
2146
2184
|
name: options.name
|
2147
|
-
})), DllReferenceAgencyPlugin =
|
2185
|
+
})), DllReferenceAgencyPlugin = (0, builtin_plugin_base.vt)(binding_.BuiltinPluginName.DllReferenceAgencyPlugin, (options)=>options), external_node_assert_namespaceObject = require("node:assert");
|
2148
2186
|
var external_node_assert_default = __webpack_require__.n(external_node_assert_namespaceObject);
|
2149
2187
|
class EntryOptionPlugin {
|
2150
2188
|
apply(compiler) {
|
@@ -2174,7 +2212,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
2174
2212
|
return options;
|
2175
2213
|
}
|
2176
2214
|
}
|
2177
|
-
let lib_EntryOptionPlugin = EntryOptionPlugin, EntryPlugin =
|
2215
|
+
let lib_EntryOptionPlugin = EntryOptionPlugin, EntryPlugin = (0, builtin_plugin_base.vt)(binding_.BuiltinPluginName.EntryPlugin, (context, entry, options = "")=>({
|
2178
2216
|
context,
|
2179
2217
|
entry,
|
2180
2218
|
options: getRawEntryOptions("string" == typeof options ? {
|
@@ -2197,7 +2235,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
2197
2235
|
};
|
2198
2236
|
}
|
2199
2237
|
EntryPlugin.createDependency = (request)=>new binding_.EntryDependency(request);
|
2200
|
-
class DynamicEntryPlugin extends
|
2238
|
+
class DynamicEntryPlugin extends builtin_plugin_base.Xj {
|
2201
2239
|
context;
|
2202
2240
|
entry;
|
2203
2241
|
name = binding_.BuiltinPluginName.DynamicEntryPlugin;
|
@@ -2216,10 +2254,10 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
2216
2254
|
};
|
2217
2255
|
})
|
2218
2256
|
};
|
2219
|
-
return
|
2257
|
+
return (0, builtin_plugin_base.no)(this.name, raw);
|
2220
2258
|
}
|
2221
2259
|
}
|
2222
|
-
let ElectronTargetPlugin =
|
2260
|
+
let ElectronTargetPlugin = (0, builtin_plugin_base.vt)(binding_.BuiltinPluginName.ElectronTargetPlugin, (context)=>context ?? "none"), EnableChunkLoadingPluginInner = (0, builtin_plugin_base.vt)(binding_.BuiltinPluginName.EnableChunkLoadingPlugin, (type)=>type), enabledTypes = new WeakMap(), getEnabledTypes = (compiler)=>{
|
2223
2261
|
let set = enabledTypes.get(compiler);
|
2224
2262
|
return void 0 === set && (set = new Set(), enabledTypes.set(compiler, set)), set;
|
2225
2263
|
};
|
@@ -2249,7 +2287,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
2249
2287
|
let set = EnableLibraryPlugin_enabledTypes.get(compiler);
|
2250
2288
|
return void 0 === set && (set = new Set(), EnableLibraryPlugin_enabledTypes.set(compiler, set)), set;
|
2251
2289
|
};
|
2252
|
-
class EnableLibraryPlugin extends
|
2290
|
+
class EnableLibraryPlugin extends builtin_plugin_base.Xj {
|
2253
2291
|
type;
|
2254
2292
|
name = binding_.BuiltinPluginName.EnableLibraryPlugin;
|
2255
2293
|
constructor(type){
|
@@ -2263,10 +2301,10 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
2263
2301
|
}
|
2264
2302
|
raw(compiler) {
|
2265
2303
|
let type = this.type, enabled = EnableLibraryPlugin_getEnabledTypes(compiler);
|
2266
|
-
if (!enabled.has(type)) return enabled.add(type),
|
2304
|
+
if (!enabled.has(type)) return enabled.add(type), (0, builtin_plugin_base.no)(this.name, type);
|
2267
2305
|
}
|
2268
2306
|
}
|
2269
|
-
let EnableWasmLoadingPlugin =
|
2307
|
+
let EnableWasmLoadingPlugin = (0, builtin_plugin_base.vt)(binding_.BuiltinPluginName.EnableWasmLoadingPlugin, (type)=>type), EnsureChunkConditionsPlugin = (0, builtin_plugin_base.vt)(binding_.BuiltinPluginName.EnsureChunkConditionsPlugin, ()=>{}), EvalDevToolModulePlugin = (0, builtin_plugin_base.vt)(binding_.BuiltinPluginName.EvalDevToolModulePlugin, (options)=>options, "compilation"), EvalSourceMapDevToolPlugin = (0, builtin_plugin_base.vt)(binding_.BuiltinPluginName.EvalSourceMapDevToolPlugin, (options)=>options, "compilation");
|
2270
2308
|
function isNil(value) {
|
2271
2309
|
return null == value;
|
2272
2310
|
}
|
@@ -2997,9 +3035,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
2997
3035
|
]
|
2998
3036
|
}).catch(handleError);
|
2999
3037
|
});
|
3000
|
-
}),
|
3001
|
-
var external_node_fs_default = __webpack_require__.n(external_node_fs_namespaceObject);
|
3002
|
-
let LoaderLoadingError = class extends Error {
|
3038
|
+
}), LoaderLoadingError = class extends Error {
|
3003
3039
|
constructor(message){
|
3004
3040
|
super(message), this.name = "LoaderRunnerError", Error.captureStackTrace(this, this.constructor);
|
3005
3041
|
}
|
@@ -4007,22 +4043,24 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
4007
4043
|
esModule: options.esModule
|
4008
4044
|
};
|
4009
4045
|
}
|
4010
|
-
class ExternalsPlugin extends
|
4046
|
+
class ExternalsPlugin extends builtin_plugin_base.Xj {
|
4011
4047
|
type;
|
4012
4048
|
externals;
|
4049
|
+
placeInInitial;
|
4013
4050
|
name = binding_.BuiltinPluginName.ExternalsPlugin;
|
4014
4051
|
#resolveRequestCache = new Map();
|
4015
|
-
constructor(type, externals){
|
4016
|
-
super(), this.type = type, this.externals = externals;
|
4052
|
+
constructor(type, externals, placeInInitial){
|
4053
|
+
super(), this.type = type, this.externals = externals, this.placeInInitial = placeInInitial;
|
4017
4054
|
}
|
4018
4055
|
raw() {
|
4019
4056
|
let type = this.type, externals = this.externals, raw = {
|
4020
4057
|
type,
|
4021
4058
|
externals: (Array.isArray(externals) ? externals : [
|
4022
4059
|
externals
|
4023
|
-
]).filter(Boolean).map((item)=>this.#getRawExternalItem(item))
|
4060
|
+
]).filter(Boolean).map((item)=>this.#getRawExternalItem(item)),
|
4061
|
+
placeInInitial: this.placeInInitial ?? !1
|
4024
4062
|
};
|
4025
|
-
return
|
4063
|
+
return (0, builtin_plugin_base.no)(this.name, raw);
|
4026
4064
|
}
|
4027
4065
|
#processResolveResult = (text)=>{
|
4028
4066
|
if (!text) return;
|
@@ -4099,8 +4137,8 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
4099
4137
|
]
|
4100
4138
|
])) : value;
|
4101
4139
|
}
|
4102
|
-
let FetchCompileAsyncWasmPlugin =
|
4103
|
-
class FlagDependencyUsagePlugin extends
|
4140
|
+
let FetchCompileAsyncWasmPlugin = (0, builtin_plugin_base.vt)(binding_.BuiltinPluginName.FetchCompileAsyncWasmPlugin, ()=>{}, "thisCompilation"), FileUriPlugin = (0, builtin_plugin_base.vt)(binding_.BuiltinPluginName.FileUriPlugin, ()=>{}, "compilation"), FlagDependencyExportsPlugin = (0, builtin_plugin_base.vt)(binding_.BuiltinPluginName.FlagDependencyExportsPlugin, ()=>{}, "compilation");
|
4141
|
+
class FlagDependencyUsagePlugin extends builtin_plugin_base.Xj {
|
4104
4142
|
global;
|
4105
4143
|
name = binding_.BuiltinPluginName.FlagDependencyUsagePlugin;
|
4106
4144
|
affectedHooks = "compilation";
|
@@ -4108,16 +4146,16 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
4108
4146
|
super(), this.global = global;
|
4109
4147
|
}
|
4110
4148
|
raw(compiler) {
|
4111
|
-
return
|
4149
|
+
return (0, builtin_plugin_base.no)(this.name, this.global);
|
4112
4150
|
}
|
4113
4151
|
}
|
4114
|
-
class HotModuleReplacementPlugin extends
|
4152
|
+
class HotModuleReplacementPlugin extends builtin_plugin_base.Xj {
|
4115
4153
|
name = binding_.BuiltinPluginName.HotModuleReplacementPlugin;
|
4116
4154
|
raw(compiler) {
|
4117
|
-
return void 0 === compiler.options.output.strictModuleErrorHandling && (compiler.options.output.strictModuleErrorHandling = !0),
|
4155
|
+
return void 0 === compiler.options.output.strictModuleErrorHandling && (compiler.options.output.strictModuleErrorHandling = !0), (0, builtin_plugin_base.no)(this.name, void 0);
|
4118
4156
|
}
|
4119
4157
|
}
|
4120
|
-
let HttpExternalsRspackPlugin =
|
4158
|
+
let HttpExternalsRspackPlugin = (0, builtin_plugin_base.vt)(binding_.BuiltinPluginName.HttpExternalsRspackPlugin, (css, webAsync)=>({
|
4121
4159
|
css,
|
4122
4160
|
webAsync
|
4123
4161
|
})), getHttp = memoize(()=>__webpack_require__("node:http")), getHttps = memoize(()=>__webpack_require__("node:https")), defaultHttpClientForNode = async (url, headers)=>{
|
@@ -4150,7 +4188,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
4150
4188
|
body: Buffer.from(body)
|
4151
4189
|
};
|
4152
4190
|
};
|
4153
|
-
class HttpUriPlugin extends
|
4191
|
+
class HttpUriPlugin extends builtin_plugin_base.Xj {
|
4154
4192
|
options;
|
4155
4193
|
name = binding_.BuiltinPluginName.HttpUriPlugin;
|
4156
4194
|
affectedHooks = "compilation";
|
@@ -4165,7 +4203,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
4165
4203
|
upgrade: options.upgrade ?? !1,
|
4166
4204
|
httpClient: options.httpClient ?? defaultHttpClientForNode
|
4167
4205
|
};
|
4168
|
-
return
|
4206
|
+
return (0, builtin_plugin_base.no)(this.name, raw);
|
4169
4207
|
}
|
4170
4208
|
}
|
4171
4209
|
function $constructor(name, initializer, params) {
|
@@ -7095,7 +7133,9 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
7095
7133
|
return !1;
|
7096
7134
|
}
|
7097
7135
|
}
|
7098
|
-
let compilationOptionsMap = new WeakMap(),
|
7136
|
+
let compilationOptionsMap = new WeakMap(), external_node_fs_namespaceObject = require("node:fs");
|
7137
|
+
var external_node_fs_default = __webpack_require__.n(external_node_fs_namespaceObject);
|
7138
|
+
let hooks_compilationHooksMap = new WeakMap(), HTML_PLUGIN_UID = 0, HtmlRspackPluginImpl = (0, builtin_plugin_base.vt)(binding_.BuiltinPluginName.HtmlRspackPlugin, function(c = {}) {
|
7099
7139
|
let templateFn, templateParameters, filenames;
|
7100
7140
|
validate(c, getHtmlPluginOptionsSchema);
|
7101
7141
|
let uid = HTML_PLUGIN_UID++, meta = {};
|
@@ -7164,9 +7204,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
7164
7204
|
let context = this.options.context || process.cwd(), templateFilePath = external_node_path_default().resolve(context, filename);
|
7165
7205
|
if (!external_node_fs_default().existsSync(templateFilePath)) throw Error(`HtmlRspackPlugin: could not load file \`${filename}\` from \`${context}\``);
|
7166
7206
|
try {
|
7167
|
-
let renderer =
|
7168
|
-
return require(id);
|
7169
|
-
}(templateFilePath);
|
7207
|
+
let renderer = require(templateFilePath);
|
7170
7208
|
if (!1 === c.templateParameters) return await renderer({});
|
7171
7209
|
return await renderer(generateRenderData(data));
|
7172
7210
|
} catch (e) {
|
@@ -7248,12 +7286,12 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
7248
7286
|
])
|
7249
7287
|
}, hooks_compilationHooksMap.set(compilation, hooks)), hooks;
|
7250
7288
|
}, HtmlRspackPlugin.version = 5;
|
7251
|
-
let IgnorePlugin =
|
7252
|
-
class JavascriptModulesPlugin extends
|
7289
|
+
let IgnorePlugin = (0, builtin_plugin_base.vt)(binding_.BuiltinPluginName.IgnorePlugin, (options)=>(validate(options, getIgnorePluginOptionsSchema), options)), InferAsyncModulesPlugin = (0, builtin_plugin_base.vt)(binding_.BuiltinPluginName.InferAsyncModulesPlugin, ()=>{}, "compilation"), JavascriptModulesPlugin_compilationHooksMap = new WeakMap();
|
7290
|
+
class JavascriptModulesPlugin extends builtin_plugin_base.Xj {
|
7253
7291
|
name = binding_.BuiltinPluginName.JavascriptModulesPlugin;
|
7254
7292
|
affectedHooks = "compilation";
|
7255
7293
|
raw() {
|
7256
|
-
return
|
7294
|
+
return (0, builtin_plugin_base.no)(this.name, void 0);
|
7257
7295
|
}
|
7258
7296
|
static getCompilationHooks(compilation) {
|
7259
7297
|
checkCompilation(compilation);
|
@@ -7266,7 +7304,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
7266
7304
|
}, JavascriptModulesPlugin_compilationHooksMap.set(compilation, hooks)), hooks;
|
7267
7305
|
}
|
7268
7306
|
}
|
7269
|
-
let JsLoaderRspackPlugin =
|
7307
|
+
let JsLoaderRspackPlugin = (0, builtin_plugin_base.vt)(binding_.BuiltinPluginName.JsLoaderRspackPlugin, (compiler)=>runLoaders.bind(null, compiler), "thisCompilation"), JsonModulesPlugin = (0, builtin_plugin_base.vt)(binding_.BuiltinPluginName.JsonModulesPlugin, ()=>{}, "compilation"), LibManifestPlugin = (0, builtin_plugin_base.vt)(binding_.BuiltinPluginName.LibManifestPlugin, (options)=>{
|
7270
7308
|
let { context, entryOnly, format, name, path, type } = options;
|
7271
7309
|
return {
|
7272
7310
|
context,
|
@@ -7276,7 +7314,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
7276
7314
|
path,
|
7277
7315
|
type
|
7278
7316
|
};
|
7279
|
-
}), LightningCssMinimizerRspackPlugin =
|
7317
|
+
}), LightningCssMinimizerRspackPlugin = (0, builtin_plugin_base.vt)(binding_.BuiltinPluginName.LightningCssMinimizerRspackPlugin, (options)=>{
|
7280
7318
|
let { include, exclude, draft, nonStandard, pseudoClasses, drafts } = options?.minimizerOptions ?? {}, targets = options?.minimizerOptions?.targets ?? "fully supports es6";
|
7281
7319
|
return {
|
7282
7320
|
test: options?.test,
|
@@ -7303,51 +7341,36 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
7303
7341
|
pseudoClasses
|
7304
7342
|
}
|
7305
7343
|
};
|
7306
|
-
}), LimitChunkCountPlugin =
|
7307
|
-
|
7308
|
-
|
7309
|
-
imports,
|
7310
|
-
entries,
|
7311
|
-
test
|
7312
|
-
}), "thisCompilation"), LAZY_COMPILATION_PREFIX = "/lazy-compilation-using-", noop = (_req, _res, next)=>{
|
7344
|
+
}), LimitChunkCountPlugin = (0, builtin_plugin_base.vt)(binding_.BuiltinPluginName.LimitChunkCountPlugin, (options)=>options);
|
7345
|
+
var lazyCompilation = __webpack_require__("./src/builtin-plugin/lazy-compilation/lazyCompilation.ts");
|
7346
|
+
let LAZY_COMPILATION_PREFIX = "/lazy-compilation-using-", noop = (_req, _res, next)=>{
|
7313
7347
|
"function" == typeof next && next();
|
7314
7348
|
}, 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.";
|
7315
|
-
function applyPlugin(compiler, options, activeModules
|
7316
|
-
|
7317
|
-
|
7318
|
-
|
7319
|
-
|
7320
|
-
|
7321
|
-
|
7322
|
-
|
7323
|
-
|
7324
|
-
|
7325
|
-
|
7326
|
-
active
|
7327
|
-
};
|
7328
|
-
}, options.cacheable ?? !0, options.entries ?? !0, options.imports ?? !0, options.test).apply(compiler);
|
7329
|
-
}
|
7330
|
-
let lazyCompilationMiddlewareInternal = (compiler, activeModules, filesByKey, lazyCompilationPrefix)=>{
|
7349
|
+
function applyPlugin(compiler, options, activeModules) {
|
7350
|
+
let compiler1;
|
7351
|
+
new lazyCompilation.a(()=>{
|
7352
|
+
let res = new Set(activeModules);
|
7353
|
+
return activeModules.clear(), res;
|
7354
|
+
}, options.entries ?? !0, options.imports ?? !0, `${options.client || (compiler1 = compiler, require.resolve(`../hot/lazy-compilation-${compiler1.options.externalsPresets.node ? "node" : "web"}.js`))}?${encodeURIComponent((({ serverUrl, prefix })=>{
|
7355
|
+
let lazyCompilationPrefix = prefix || LAZY_COMPILATION_PREFIX;
|
7356
|
+
return serverUrl ? serverUrl + (serverUrl.endsWith("/") ? lazyCompilationPrefix.slice(1) : lazyCompilationPrefix) : lazyCompilationPrefix;
|
7357
|
+
})(options))}`, options.test).apply(compiler);
|
7358
|
+
}
|
7359
|
+
let lazyCompilationMiddlewareInternal = (compiler, activeModules, lazyCompilationPrefix)=>{
|
7331
7360
|
let logger = compiler.getInfrastructureLogger("LazyCompilation");
|
7332
7361
|
return (req, res, next)=>{
|
7333
7362
|
if (!req.url?.startsWith(lazyCompilationPrefix)) return next?.();
|
7334
|
-
let modules = req.url.slice(lazyCompilationPrefix.length).split("@");
|
7363
|
+
let modules = req.url.slice(lazyCompilationPrefix.length).split("@").map(decodeURIComponent);
|
7335
7364
|
req.socket.setNoDelay(!0), res.setHeader("content-type", "text/event-stream"), res.writeHead(200), res.write("\n");
|
7336
7365
|
let moduleActivated = [];
|
7337
7366
|
for (let key of modules){
|
7338
7367
|
let activated = activeModules.has(key);
|
7339
7368
|
activeModules.add(key), activated || (logger.log(`${key} is now in use and will be compiled.`), moduleActivated.push(key));
|
7340
7369
|
}
|
7341
|
-
|
7342
|
-
let rebuiltModules = new Set(moduleActivated.map((key)=>{
|
7343
|
-
let filePath = filesByKey.get(key);
|
7344
|
-
return filePath || logger.warn(`Cannot find correct file path for module ${key}`), filePath;
|
7345
|
-
}).filter(Boolean));
|
7346
|
-
rebuiltModules.size && compiler.watching.invalidateWithChangesAndRemovals(rebuiltModules);
|
7347
|
-
}
|
7370
|
+
moduleActivated.length && compiler.watching && compiler.watching.invalidate();
|
7348
7371
|
};
|
7349
7372
|
};
|
7350
|
-
class MangleExportsPlugin extends
|
7373
|
+
class MangleExportsPlugin extends builtin_plugin_base.Xj {
|
7351
7374
|
deterministic;
|
7352
7375
|
name = binding_.BuiltinPluginName.MangleExportsPlugin;
|
7353
7376
|
affectedHooks = "compilation";
|
@@ -7355,47 +7378,47 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
7355
7378
|
super(), this.deterministic = deterministic;
|
7356
7379
|
}
|
7357
7380
|
raw(compiler) {
|
7358
|
-
return
|
7381
|
+
return (0, builtin_plugin_base.no)(this.name, this.deterministic);
|
7359
7382
|
}
|
7360
7383
|
}
|
7361
|
-
let MergeDuplicateChunksPlugin =
|
7362
|
-
class ModuleConcatenationPlugin extends
|
7384
|
+
let MergeDuplicateChunksPlugin = (0, builtin_plugin_base.vt)(binding_.BuiltinPluginName.MergeDuplicateChunksPlugin, ()=>{}), ModuleChunkFormatPlugin = (0, builtin_plugin_base.vt)(binding_.BuiltinPluginName.ModuleChunkFormatPlugin, ()=>{});
|
7385
|
+
class ModuleConcatenationPlugin extends builtin_plugin_base.Xj {
|
7363
7386
|
name = binding_.BuiltinPluginName.ModuleConcatenationPlugin;
|
7364
7387
|
affectedHooks = "compilation";
|
7365
7388
|
raw(compiler) {
|
7366
|
-
return
|
7389
|
+
return (0, builtin_plugin_base.no)(this.name, void 0);
|
7367
7390
|
}
|
7368
7391
|
}
|
7369
|
-
let ModuleInfoHeaderPlugin =
|
7370
|
-
class NaturalChunkIdsPlugin extends
|
7392
|
+
let ModuleInfoHeaderPlugin = (0, builtin_plugin_base.vt)(binding_.BuiltinPluginName.ModuleInfoHeaderPlugin, (verbose)=>verbose, "compilation"), NamedChunkIdsPlugin = (0, builtin_plugin_base.vt)(binding_.BuiltinPluginName.NamedChunkIdsPlugin, ()=>{}, "compilation"), NamedModuleIdsPlugin = (0, builtin_plugin_base.vt)(binding_.BuiltinPluginName.NamedModuleIdsPlugin, ()=>{}, "compilation");
|
7393
|
+
class NaturalChunkIdsPlugin extends builtin_plugin_base.Xj {
|
7371
7394
|
name = binding_.BuiltinPluginName.NaturalChunkIdsPlugin;
|
7372
7395
|
affectedHooks = "compilation";
|
7373
7396
|
raw(compiler) {
|
7374
|
-
return
|
7397
|
+
return (0, builtin_plugin_base.no)(this.name, void 0);
|
7375
7398
|
}
|
7376
7399
|
}
|
7377
|
-
class NaturalModuleIdsPlugin extends
|
7400
|
+
class NaturalModuleIdsPlugin extends builtin_plugin_base.Xj {
|
7378
7401
|
name = binding_.BuiltinPluginName.NaturalModuleIdsPlugin;
|
7379
7402
|
affectedHooks = "compilation";
|
7380
7403
|
raw(compiler) {
|
7381
|
-
return
|
7404
|
+
return (0, builtin_plugin_base.no)(this.name, void 0);
|
7382
7405
|
}
|
7383
7406
|
}
|
7384
|
-
let NodeTargetPlugin =
|
7407
|
+
let NodeTargetPlugin = (0, builtin_plugin_base.vt)(binding_.BuiltinPluginName.NodeTargetPlugin, ()=>void 0), NoEmitOnErrorsPlugin = (0, builtin_plugin_base.vt)(binding_.BuiltinPluginName.NoEmitOnErrorsPlugin, ()=>void 0), NormalModuleReplacementPlugin = (0, builtin_plugin_base.vt)(binding_.BuiltinPluginName.NormalModuleReplacementPlugin, (resourceRegExp, newResource)=>({
|
7385
7408
|
resourceRegExp,
|
7386
7409
|
newResource: "function" == typeof newResource ? (data)=>(newResource(data), data) : newResource
|
7387
|
-
})), OccurrenceChunkIdsPlugin =
|
7410
|
+
})), OccurrenceChunkIdsPlugin = (0, builtin_plugin_base.vt)(binding_.BuiltinPluginName.OccurrenceChunkIdsPlugin, (options)=>({
|
7388
7411
|
...options
|
7389
|
-
}), "compilation"), ProgressPlugin =
|
7412
|
+
}), "compilation"), ProgressPlugin = (0, builtin_plugin_base.vt)(binding_.BuiltinPluginName.ProgressPlugin, (progress = {})=>"function" == typeof progress ? {
|
7390
7413
|
handler: (percentage, msg, items)=>{
|
7391
7414
|
progress(percentage, msg, ...items);
|
7392
7415
|
}
|
7393
|
-
} : progress), ProvidePlugin =
|
7416
|
+
} : progress), ProvidePlugin = (0, builtin_plugin_base.vt)(binding_.BuiltinPluginName.ProvidePlugin, (provide)=>Object.fromEntries(Object.entries(provide).map(([key, value])=>("string" == typeof value && (value = [
|
7394
7417
|
value
|
7395
7418
|
]), [
|
7396
7419
|
key,
|
7397
7420
|
value
|
7398
|
-
]))), "compilation"), RealContentHashPlugin =
|
7421
|
+
]))), "compilation"), RealContentHashPlugin = (0, builtin_plugin_base.vt)(binding_.BuiltinPluginName.RealContentHashPlugin, ()=>{}, "compilation"), RemoveDuplicateModulesPlugin = (0, builtin_plugin_base.vt)(binding_.BuiltinPluginName.RemoveDuplicateModulesPlugin, ()=>({})), RemoveEmptyChunksPlugin = (0, builtin_plugin_base.vt)(binding_.BuiltinPluginName.RemoveEmptyChunksPlugin, ()=>{}, "compilation"), RsdoctorPluginImpl = (0, builtin_plugin_base.vt)(binding_.BuiltinPluginName.RsdoctorPlugin, function(c = {
|
7399
7422
|
moduleGraphFeatures: !0,
|
7400
7423
|
chunkGraphFeatures: !0
|
7401
7424
|
}) {
|
@@ -7426,7 +7449,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
7426
7449
|
])
|
7427
7450
|
}, RsdoctorPlugin_compilationHooksMap.set(compilation, hooks)), hooks;
|
7428
7451
|
};
|
7429
|
-
let RslibPlugin =
|
7452
|
+
let RslibPlugin = (0, builtin_plugin_base.vt)(binding_.BuiltinPluginName.RslibPlugin, (rslib)=>rslib), RstestPlugin = (0, builtin_plugin_base.vt)(binding_.BuiltinPluginName.RstestPlugin, (rstest)=>rstest), RuntimeChunkPlugin = (0, builtin_plugin_base.vt)(binding_.BuiltinPluginName.RuntimeChunkPlugin, (options)=>options, "thisCompilation"), RuntimePlugin = (0, builtin_plugin_base.vt)(binding_default().BuiltinPluginName.RuntimePlugin, ()=>{}, "compilation"), RuntimePlugin_compilationHooksMap = new WeakMap();
|
7430
7453
|
RuntimePlugin.getHooks = RuntimePlugin.getCompilationHooks = (compilation)=>{
|
7431
7454
|
checkCompilation(compilation);
|
7432
7455
|
let hooks = RuntimePlugin_compilationHooksMap.get(compilation);
|
@@ -7445,13 +7468,13 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
7445
7468
|
])
|
7446
7469
|
}, RuntimePlugin_compilationHooksMap.set(compilation, hooks)), hooks;
|
7447
7470
|
};
|
7448
|
-
let SideEffectsFlagPlugin =
|
7471
|
+
let SideEffectsFlagPlugin = (0, builtin_plugin_base.vt)(binding_.BuiltinPluginName.SideEffectsFlagPlugin, ()=>{}, "compilation"), SizeLimitsPlugin = (0, builtin_plugin_base.vt)(binding_.BuiltinPluginName.SizeLimitsPlugin, (options)=>{
|
7449
7472
|
let hints = !1 === options.hints ? void 0 : options.hints;
|
7450
7473
|
return {
|
7451
7474
|
...options,
|
7452
7475
|
hints
|
7453
7476
|
};
|
7454
|
-
}), SourceMapDevToolPlugin =
|
7477
|
+
}), SourceMapDevToolPlugin = (0, builtin_plugin_base.vt)(binding_.BuiltinPluginName.SourceMapDevToolPlugin, (options)=>options, "compilation");
|
7455
7478
|
class JsSplitChunkSizes {
|
7456
7479
|
static __to_binding(sizes) {
|
7457
7480
|
return "number" == typeof sizes ? sizes : sizes && "object" == typeof sizes ? {
|
@@ -7459,7 +7482,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
7459
7482
|
} : sizes;
|
7460
7483
|
}
|
7461
7484
|
}
|
7462
|
-
class SplitChunksPlugin extends
|
7485
|
+
class SplitChunksPlugin extends builtin_plugin_base.Xj {
|
7463
7486
|
options;
|
7464
7487
|
name = binding_.BuiltinPluginName.SplitChunksPlugin;
|
7465
7488
|
affectedHooks = "thisCompilation";
|
@@ -7517,10 +7540,10 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
7517
7540
|
...passThrough
|
7518
7541
|
};
|
7519
7542
|
}(this.options, compiler);
|
7520
|
-
return external_node_assert_default()(void 0 !== rawOptions),
|
7543
|
+
return external_node_assert_default()(void 0 !== rawOptions), (0, builtin_plugin_base.no)(this.name, rawOptions);
|
7521
7544
|
}
|
7522
7545
|
}
|
7523
|
-
let SubresourceIntegrityPlugin_PLUGIN_NAME = "SubresourceIntegrityPlugin", NATIVE_HTML_PLUGIN = "HtmlRspackPlugin", NativeSubresourceIntegrityPlugin =
|
7546
|
+
let SubresourceIntegrityPlugin_PLUGIN_NAME = "SubresourceIntegrityPlugin", NATIVE_HTML_PLUGIN = "HtmlRspackPlugin", NativeSubresourceIntegrityPlugin = (0, builtin_plugin_base.vt)(binding_.BuiltinPluginName.SubresourceIntegrityPlugin, function(options) {
|
7524
7547
|
let htmlPlugin = "Disabled";
|
7525
7548
|
return options.htmlPlugin === NATIVE_HTML_PLUGIN ? htmlPlugin = "Native" : "string" == typeof options.htmlPlugin && (htmlPlugin = "JavaScript"), {
|
7526
7549
|
hashFuncNames: options.hashFuncNames,
|
@@ -7646,7 +7669,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
7646
7669
|
function normalizePath(path) {
|
7647
7670
|
return path.replace(/\?.*$/, "").split(external_node_path_namespaceObject.sep).join("/");
|
7648
7671
|
}
|
7649
|
-
let SwcJsMinimizerRspackPlugin =
|
7672
|
+
let SwcJsMinimizerRspackPlugin = (0, builtin_plugin_base.vt)(binding_.BuiltinPluginName.SwcJsMinimizerRspackPlugin, (options)=>{
|
7650
7673
|
let compress = options?.minimizerOptions?.compress ?? !0, mangle = options?.minimizerOptions?.mangle ?? !0, ecma = options?.minimizerOptions?.ecma ?? 5, format = {
|
7651
7674
|
comments: !1,
|
7652
7675
|
...options?.minimizerOptions?.format
|
@@ -7695,14 +7718,14 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
7695
7718
|
module: options?.minimizerOptions?.module
|
7696
7719
|
}
|
7697
7720
|
};
|
7698
|
-
}, "compilation"), WarnCaseSensitiveModulesPlugin =
|
7699
|
-
class WebWorkerTemplatePlugin extends
|
7721
|
+
}, "compilation"), WarnCaseSensitiveModulesPlugin = (0, builtin_plugin_base.vt)(binding_.BuiltinPluginName.WarnCaseSensitiveModulesPlugin, ()=>{}, "compilation");
|
7722
|
+
class WebWorkerTemplatePlugin extends builtin_plugin_base.Xj {
|
7700
7723
|
name = binding_.BuiltinPluginName.WebWorkerTemplatePlugin;
|
7701
7724
|
raw(compiler) {
|
7702
|
-
return compiler.options.output.chunkLoading = "import-scripts",
|
7725
|
+
return compiler.options.output.chunkLoading = "import-scripts", (0, builtin_plugin_base.no)(this.name, void 0);
|
7703
7726
|
}
|
7704
7727
|
}
|
7705
|
-
class WorkerPlugin extends
|
7728
|
+
class WorkerPlugin extends builtin_plugin_base.Xj {
|
7706
7729
|
chunkLoading;
|
7707
7730
|
wasmLoading;
|
7708
7731
|
module;
|
@@ -7712,7 +7735,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
7712
7735
|
super(), this.chunkLoading = chunkLoading, this.wasmLoading = wasmLoading, this.module = module, this.workerPublicPath = workerPublicPath;
|
7713
7736
|
}
|
7714
7737
|
raw(compiler) {
|
7715
|
-
return this.chunkLoading && new EnableChunkLoadingPlugin(this.chunkLoading).apply(compiler), this.wasmLoading && new EnableWasmLoadingPlugin(this.wasmLoading).apply(compiler),
|
7738
|
+
return this.chunkLoading && new EnableChunkLoadingPlugin(this.chunkLoading).apply(compiler), this.wasmLoading && new EnableWasmLoadingPlugin(this.wasmLoading).apply(compiler), (0, builtin_plugin_base.no)(this.name, void 0);
|
7716
7739
|
}
|
7717
7740
|
}
|
7718
7741
|
class ContextModuleFactory {
|
@@ -8629,7 +8652,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
8629
8652
|
}, applyExperimentsDefaults = (experiments, { production, development })=>{
|
8630
8653
|
defaults_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, "layers", !1), !1 === experiments.topLevelAwait && console.warn("`experiments.topLevelAwait` config has been deprecated and will be removed in Rspack v2.0. Top-level await will be always enabled. Please remove this option from your Rspack configuration."), D(experiments, "topLevelAwait", !0), 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", !0), 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, "parallelCodeSplitting", !1), D(experiments, "parallelLoader", !1), D(experiments, "useInputFileSystem", !1), D(experiments, "inlineConst", !1), D(experiments, "inlineEnum", !1), D(experiments, "typeReexportsPresence", !1), D(experiments, "lazyBarrel", !1);
|
8631
8654
|
}, applybundlerInfoDefaults = (rspackFuture, library)=>{
|
8632
|
-
"object" == typeof rspackFuture && (D(rspackFuture, "bundlerInfo", {}), "object" == typeof rspackFuture.bundlerInfo && (D(rspackFuture.bundlerInfo, "version", "1.5.
|
8655
|
+
"object" == typeof rspackFuture && (D(rspackFuture, "bundlerInfo", {}), "object" == typeof rspackFuture.bundlerInfo && (D(rspackFuture.bundlerInfo, "version", "1.5.1"), D(rspackFuture.bundlerInfo, "bundler", "rspack"), D(rspackFuture.bundlerInfo, "force", !library)));
|
8633
8656
|
}, applySnapshotDefaults = (_snapshot, _env)=>{}, applyModuleDefaults = (module, { asyncWebAssembly, css, targetProperties, mode, uniqueName, inlineConst })=>{
|
8634
8657
|
if (assertNotNill(module.parser), assertNotNill(module.generator), defaults_F(module.parser, "asset", ()=>({})), assertNotNill(module.parser.asset), defaults_F(module.parser.asset, "dataUrlCondition", ()=>({})), "object" == typeof module.parser.asset.dataUrlCondition && D(module.parser.asset.dataUrlCondition, "maxSize", 8096), defaults_F(module.parser, "javascript", ()=>({})), assertNotNill(module.parser.javascript), ((parserOptions, { inlineConst })=>{
|
8635
8658
|
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, "importDynamic", !0), D(parserOptions, "worker", [
|
@@ -10272,7 +10295,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
10272
10295
|
});
|
10273
10296
|
}
|
10274
10297
|
}
|
10275
|
-
let CORE_VERSION = "1.5.
|
10298
|
+
let CORE_VERSION = "1.5.1", bindingVersionCheck_errorMessage = (coreVersion, expectedCoreVersion)=>process.env.RSPACK_BINDING ? `Unmatched version @rspack/core@${coreVersion} and binding version.
|
10276
10299
|
|
10277
10300
|
Help:
|
10278
10301
|
Looks like you are using a custom binding (via environment variable 'RSPACK_BINDING=${process.env.RSPACK_BINDING}').
|
@@ -10572,6 +10595,7 @@ Help:
|
|
10572
10595
|
cache;
|
10573
10596
|
compilerPath;
|
10574
10597
|
options;
|
10598
|
+
__internal_browser_require;
|
10575
10599
|
constructor(context, options){
|
10576
10600
|
this.#initial = !0, this.#builtinPlugins = [], this.#nonSkippableRegisters = [], this.#moduleExecutionResultsMap = new Map(), this.#ruleSet = new RuleSetCompiler(), this.hooks = {
|
10577
10601
|
initialize: new lite_tapable_namespaceObject.SyncHook([]),
|
@@ -10659,7 +10683,9 @@ Help:
|
|
10659
10683
|
"entry"
|
10660
10684
|
]),
|
10661
10685
|
additionalPass: new lite_tapable_namespaceObject.AsyncSeriesHook([])
|
10662
|
-
}, this.webpack = src_rspack, this.rspack = src_rspack, this.root = this, this.outputPath = "", this.inputFileSystem = null, this.intermediateFileSystem = null, this.outputFileSystem = null, this.watchFileSystem = null, this.records = {}, this.options = options, this.context = context, this.cache = new Cache(), this.compilerPath = "", this.running = !1, this.idle = !1, this.watchMode = !1, this.
|
10686
|
+
}, this.webpack = src_rspack, this.rspack = src_rspack, this.root = this, this.outputPath = "", this.inputFileSystem = null, this.intermediateFileSystem = null, this.outputFileSystem = null, this.watchFileSystem = null, this.records = {}, this.options = options, this.context = context, this.cache = new Cache(), this.compilerPath = "", this.running = !1, this.idle = !1, this.watchMode = !1, this.__internal_browser_require = ()=>{
|
10687
|
+
throw Error("Cannot execute user defined code in browser without `BrowserRequirePlugin`");
|
10688
|
+
}, this.resolverFactory = new ResolverFactory(options.resolve.pnp ?? getPnpDefault(), options.resolve, options.resolveLoader), new JsLoaderRspackPlugin(this).apply(this), new ExecuteModulePlugin().apply(this), new TraceHookPlugin().apply(this);
|
10663
10689
|
}
|
10664
10690
|
get recordsInputPath() {
|
10665
10691
|
return unsupported("Compiler.recordsInputPath");
|
@@ -10784,7 +10810,7 @@ Help:
|
|
10784
10810
|
for(let hookName in childCompiler.#builtinPlugins = [
|
10785
10811
|
...childCompiler.#builtinPlugins,
|
10786
10812
|
...this.#builtinPlugins.filter((plugin)=>!0 === plugin.canInherentFromParent)
|
10787
|
-
], this.hooks)
|
10813
|
+
], this.hooks)(0, builtin_plugin_base.Gp)(hookName) && childCompiler.hooks[hookName] && (childCompiler.hooks[hookName].taps = this.hooks[hookName].taps.slice());
|
10788
10814
|
return compilation.hooks.childCompiler.call(childCompiler, compilerName, compilerIndex), childCompiler;
|
10789
10815
|
}
|
10790
10816
|
isChild() {
|
@@ -11553,7 +11579,7 @@ Help:
|
|
11553
11579
|
obj.children = this.stats.map((stat, idx)=>{
|
11554
11580
|
let obj = stat.toJson(childOptions.children[idx]), compilationName = stat.compilation.name;
|
11555
11581
|
return obj.name = compilationName && makePathsRelative(childOptions.context, compilationName, stat.compilation.compiler.root), obj;
|
11556
|
-
}), childOptions.version && (obj.rspackVersion = "1.5.
|
11582
|
+
}), childOptions.version && (obj.rspackVersion = "1.5.1", obj.version = "5.75.0"), childOptions.hash && (obj.hash = obj.children.map((j)=>j.hash).join(""));
|
11557
11583
|
let mapError = (j, obj)=>({
|
11558
11584
|
...obj,
|
11559
11585
|
compilerPath: obj.compilerPath ? `${j.name}.${obj.compilerPath}` : j.name
|
@@ -12453,7 +12479,7 @@ Help:
|
|
12453
12479
|
object.hash = context.getStatsCompilation(compilation).hash;
|
12454
12480
|
},
|
12455
12481
|
version: (object)=>{
|
12456
|
-
object.version = "5.75.0", object.rspackVersion = "1.5.
|
12482
|
+
object.version = "5.75.0", object.rspackVersion = "1.5.1";
|
12457
12483
|
},
|
12458
12484
|
env: (object, _compilation, _context, { _env })=>{
|
12459
12485
|
object.env = _env;
|
@@ -13773,7 +13799,7 @@ Help:
|
|
13773
13799
|
}
|
13774
13800
|
class RspackOptionsApply {
|
13775
13801
|
process(options, compiler) {
|
13776
|
-
if (external_node_assert_default()(options.output.path, "options.output.path should have value after `applyRspackOptionsDefaults`"), compiler.outputPath = options.output.path, compiler.name = options.name, compiler.outputFileSystem = graceful_fs_index_js_default(), options.externals && (external_node_assert_default()(options.externalsType, "options.externalsType should have value after `applyRspackOptionsDefaults`"), new ExternalsPlugin(options.externalsType, options.externals).apply(compiler)), options.externalsPresets.node && new NodeTargetPlugin().apply(compiler), options.externalsPresets.electronMain && new ElectronTargetPlugin("main").apply(compiler), options.externalsPresets.electronPreload && new ElectronTargetPlugin("preload").apply(compiler), options.externalsPresets.electronRenderer && new ElectronTargetPlugin("renderer").apply(compiler), !options.externalsPresets.electron || options.externalsPresets.electronMain || options.externalsPresets.electronPreload || options.externalsPresets.electronRenderer || new ElectronTargetPlugin().apply(compiler), options.externalsPresets.nwjs && new ExternalsPlugin("node-commonjs", "nw.gui").apply(compiler), (options.externalsPresets.web || options.externalsPresets.webAsync || options.externalsPresets.node && options.experiments.css) && new HttpExternalsRspackPlugin(!!options.experiments.css, !!options.externalsPresets.webAsync).apply(compiler), new ChunkPrefetchPreloadPlugin().apply(compiler), options.output.pathinfo && new ModuleInfoHeaderPlugin("verbose" === options.output.pathinfo).apply(compiler), "string" == typeof options.output.chunkFormat) switch(options.output.chunkFormat){
|
13802
|
+
if (external_node_assert_default()(options.output.path, "options.output.path should have value after `applyRspackOptionsDefaults`"), compiler.outputPath = options.output.path, compiler.name = options.name, compiler.outputFileSystem = graceful_fs_index_js_default(), options.externals && (external_node_assert_default()(options.externalsType, "options.externalsType should have value after `applyRspackOptionsDefaults`"), new ExternalsPlugin(options.externalsType, options.externals, !1).apply(compiler)), options.externalsPresets.node && new NodeTargetPlugin().apply(compiler), options.externalsPresets.electronMain && new ElectronTargetPlugin("main").apply(compiler), options.externalsPresets.electronPreload && new ElectronTargetPlugin("preload").apply(compiler), options.externalsPresets.electronRenderer && new ElectronTargetPlugin("renderer").apply(compiler), !options.externalsPresets.electron || options.externalsPresets.electronMain || options.externalsPresets.electronPreload || options.externalsPresets.electronRenderer || new ElectronTargetPlugin().apply(compiler), options.externalsPresets.nwjs && new ExternalsPlugin("node-commonjs", "nw.gui", !1).apply(compiler), (options.externalsPresets.web || options.externalsPresets.webAsync || options.externalsPresets.node && options.experiments.css) && new HttpExternalsRspackPlugin(!!options.experiments.css, !!options.externalsPresets.webAsync).apply(compiler), new ChunkPrefetchPreloadPlugin().apply(compiler), options.output.pathinfo && new ModuleInfoHeaderPlugin("verbose" === options.output.pathinfo).apply(compiler), "string" == typeof options.output.chunkFormat) switch(options.output.chunkFormat){
|
13777
13803
|
case "array-push":
|
13778
13804
|
new ArrayPushCallbackChunkFormatPlugin().apply(compiler);
|
13779
13805
|
break;
|
@@ -13913,7 +13939,7 @@ Help:
|
|
13913
13939
|
return this._emitFile(filename, JsSource.__to_binding(source), assetInfo);
|
13914
13940
|
}
|
13915
13941
|
});
|
13916
|
-
let asRegExp = (test)=>"string" == typeof test ? RegExp(`^${test.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&")}`) : test, matchPart = (str, test)=>!test || (Array.isArray(test) ? test.map(asRegExp).some((regExp)=>regExp.test(str)) : asRegExp(test).test(str)), matchObject = (obj, str)=>!(obj.test && !matchPart(str, obj.test) || obj.include && !matchPart(str, obj.include) || obj.exclude && matchPart(str, obj.exclude)), FlagAllModulesAsUsedPlugin =
|
13942
|
+
let asRegExp = (test)=>"string" == typeof test ? RegExp(`^${test.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&")}`) : test, matchPart = (str, test)=>!test || (Array.isArray(test) ? test.map(asRegExp).some((regExp)=>regExp.test(str)) : asRegExp(test).test(str)), matchObject = (obj, str)=>!(obj.test && !matchPart(str, obj.test) || obj.include && !matchPart(str, obj.include) || obj.exclude && matchPart(str, obj.exclude)), FlagAllModulesAsUsedPlugin = (0, builtin_plugin_base.vt)(binding_.BuiltinPluginName.FlagAllModulesAsUsedPlugin, (explanation)=>({
|
13917
13943
|
explanation
|
13918
13944
|
}));
|
13919
13945
|
class DllPlugin {
|
@@ -14531,6 +14557,7 @@ Help:
|
|
14531
14557
|
"2022-03"
|
14532
14558
|
]),
|
14533
14559
|
treatConstEnumAsEnum: schemas_boolean(),
|
14560
|
+
tsEnumIsMutable: schemas_boolean(),
|
14534
14561
|
useDefineForClassFields: schemas_boolean(),
|
14535
14562
|
verbatimModuleSyntax: schemas_boolean()
|
14536
14563
|
}).partial(), ZodSwcJsMinifyOptions = strictObject({
|
@@ -15503,7 +15530,7 @@ Help:
|
|
15503
15530
|
"externals"
|
15504
15531
|
]));
|
15505
15532
|
});
|
15506
|
-
}), ModuleFederationRuntimePlugin =
|
15533
|
+
}), ModuleFederationRuntimePlugin = (0, builtin_plugin_base.vt)(binding_.BuiltinPluginName.ModuleFederationRuntimePlugin, (options = {})=>options), parseOptions = (options, normalizeSimple, normalizeOptions)=>{
|
15507
15534
|
let items = [];
|
15508
15535
|
var options1 = options, normalizeSimple1 = normalizeSimple, normalizeOptions1 = normalizeOptions, fn = (key, value)=>{
|
15509
15536
|
items.push([
|
@@ -15523,7 +15550,7 @@ Help:
|
|
15523
15550
|
else throw Error("Unexpected options format");
|
15524
15551
|
return items;
|
15525
15552
|
}, compilerSet = new WeakSet();
|
15526
|
-
class ShareRuntimePlugin extends
|
15553
|
+
class ShareRuntimePlugin extends builtin_plugin_base.Xj {
|
15527
15554
|
enhanced;
|
15528
15555
|
name = binding_.BuiltinPluginName.ShareRuntimePlugin;
|
15529
15556
|
constructor(enhanced = !1){
|
@@ -15531,11 +15558,11 @@ Help:
|
|
15531
15558
|
}
|
15532
15559
|
raw(compiler) {
|
15533
15560
|
var compiler1, compiler2;
|
15534
|
-
if (compiler1 = compiler, !compilerSet.has(compiler1)) return compiler2 = compiler, compilerSet.add(compiler2),
|
15561
|
+
if (compiler1 = compiler, !compilerSet.has(compiler1)) return compiler2 = compiler, compilerSet.add(compiler2), (0, builtin_plugin_base.no)(this.name, this.enhanced);
|
15535
15562
|
}
|
15536
15563
|
}
|
15537
15564
|
let VERSION_PATTERN_REGEXP = /^([\d^=v<>~]|[*xX]$)/;
|
15538
|
-
class ConsumeSharedPlugin extends
|
15565
|
+
class ConsumeSharedPlugin extends builtin_plugin_base.Xj {
|
15539
15566
|
name = binding_.BuiltinPluginName.ConsumeSharedPlugin;
|
15540
15567
|
_options;
|
15541
15568
|
constructor(options){
|
@@ -15584,10 +15611,10 @@ Help:
|
|
15584
15611
|
})),
|
15585
15612
|
enhanced: this._options.enhanced
|
15586
15613
|
};
|
15587
|
-
return
|
15614
|
+
return (0, builtin_plugin_base.no)(this.name, rawOptions);
|
15588
15615
|
}
|
15589
15616
|
}
|
15590
|
-
class ProvideSharedPlugin extends
|
15617
|
+
class ProvideSharedPlugin extends builtin_plugin_base.Xj {
|
15591
15618
|
name = binding_.BuiltinPluginName.ProvideSharedPlugin;
|
15592
15619
|
_provides;
|
15593
15620
|
_enhanced;
|
@@ -15621,7 +15648,7 @@ Help:
|
|
15621
15648
|
key,
|
15622
15649
|
...v
|
15623
15650
|
}));
|
15624
|
-
return
|
15651
|
+
return (0, builtin_plugin_base.no)(this.name, rawOptions);
|
15625
15652
|
}
|
15626
15653
|
}
|
15627
15654
|
class SharePlugin {
|
@@ -15675,7 +15702,7 @@ Help:
|
|
15675
15702
|
}).apply(compiler);
|
15676
15703
|
}
|
15677
15704
|
}
|
15678
|
-
class ContainerPlugin extends
|
15705
|
+
class ContainerPlugin extends builtin_plugin_base.Xj {
|
15679
15706
|
name = binding_.BuiltinPluginName.ContainerPlugin;
|
15680
15707
|
_options;
|
15681
15708
|
constructor(options){
|
@@ -15717,10 +15744,10 @@ Help:
|
|
15717
15744
|
})),
|
15718
15745
|
enhanced
|
15719
15746
|
};
|
15720
|
-
return
|
15747
|
+
return (0, builtin_plugin_base.no)(this.name, rawOptions);
|
15721
15748
|
}
|
15722
15749
|
}
|
15723
|
-
class ContainerReferencePlugin extends
|
15750
|
+
class ContainerReferencePlugin extends builtin_plugin_base.Xj {
|
15724
15751
|
name = binding_.BuiltinPluginName.ContainerReferencePlugin;
|
15725
15752
|
_options;
|
15726
15753
|
constructor(options){
|
@@ -15746,7 +15773,7 @@ Help:
|
|
15746
15773
|
let i = 0;
|
15747
15774
|
for (let external of config.external)!external.startsWith("internal ") && (remoteExternals[`webpack/container/reference/${key}${i ? `/fallback-${i}` : ""}`] = external, i++);
|
15748
15775
|
}
|
15749
|
-
new ExternalsPlugin(remoteType, remoteExternals).apply(compiler), new ShareRuntimePlugin(this._options.enhanced).apply(compiler);
|
15776
|
+
new ExternalsPlugin(remoteType, remoteExternals, !0).apply(compiler), new ShareRuntimePlugin(this._options.enhanced).apply(compiler);
|
15750
15777
|
let rawOptions = {
|
15751
15778
|
remoteType: this._options.remoteType,
|
15752
15779
|
remotes: this._options.remotes.map(([key, r])=>({
|
@@ -15755,7 +15782,7 @@ Help:
|
|
15755
15782
|
})),
|
15756
15783
|
enhanced: this._options.enhanced
|
15757
15784
|
};
|
15758
|
-
return
|
15785
|
+
return (0, builtin_plugin_base.no)(this.name, rawOptions);
|
15759
15786
|
}
|
15760
15787
|
}
|
15761
15788
|
async function minify(source, options) {
|
@@ -15766,7 +15793,7 @@ Help:
|
|
15766
15793
|
let _options = JSON.stringify(options || {});
|
15767
15794
|
return binding_default().transform(source, _options);
|
15768
15795
|
}
|
15769
|
-
let exports_rspackVersion = "1.5.
|
15796
|
+
let exports_rspackVersion = "1.5.1", exports_version = "5.75.0", exports_WebpackError = Error, sources = __webpack_require__("webpack-sources"), exports_config = {
|
15770
15797
|
getNormalizedRspackOptions: getNormalizedRspackOptions,
|
15771
15798
|
applyRspackOptionsDefaults: applyRspackOptionsDefaults,
|
15772
15799
|
getNormalizedWebpackOptions: getNormalizedRspackOptions,
|
@@ -15971,8 +15998,8 @@ Help:
|
|
15971
15998
|
...c.options.lazyCompilation
|
15972
15999
|
}, prefix = options.prefix || LAZY_COMPILATION_PREFIX;
|
15973
16000
|
options.prefix = `${prefix}__${i++}`;
|
15974
|
-
let activeModules = new Set()
|
15975
|
-
middlewareByCompiler.set(options.prefix, lazyCompilationMiddlewareInternal(compiler, activeModules,
|
16001
|
+
let activeModules = new Set();
|
16002
|
+
middlewareByCompiler.set(options.prefix, lazyCompilationMiddlewareInternal(compiler, activeModules, options.prefix)), applyPlugin(c, options, activeModules);
|
15976
16003
|
}
|
15977
16004
|
let keys = [
|
15978
16005
|
...middlewareByCompiler.keys()
|
@@ -15985,11 +16012,11 @@ Help:
|
|
15985
16012
|
};
|
15986
16013
|
}
|
15987
16014
|
if (compiler.options.experiments.lazyCompilation && (console.warn(DEPRECATED_LAZY_COMPILATION_OPTIONS_WARN), compiler.options.lazyCompilation && console.warn(REPEAT_LAZY_COMPILATION_OPTIONS_WARN)), !compiler.options.lazyCompilation && !compiler.options.experiments.lazyCompilation) return noop;
|
15988
|
-
let activeModules = new Set(),
|
16015
|
+
let activeModules = new Set(), options = {
|
15989
16016
|
...compiler.options.experiments.lazyCompilation,
|
15990
16017
|
...compiler.options.lazyCompilation
|
15991
16018
|
};
|
15992
|
-
return applyPlugin(compiler, options, activeModules
|
16019
|
+
return applyPlugin(compiler, options, activeModules), lazyCompilationMiddlewareInternal(compiler, activeModules, options.prefix || LAZY_COMPILATION_PREFIX);
|
15993
16020
|
},
|
15994
16021
|
swc: {
|
15995
16022
|
minify: minify,
|
@@ -16010,10 +16037,7 @@ Help:
|
|
16010
16037
|
sync: binding_.sync
|
16011
16038
|
},
|
16012
16039
|
CssChunkingPlugin: CssChunkingPlugin,
|
16013
|
-
createNativePlugin:
|
16014
|
-
if (INTERNAL_PLUGIN_NAMES.includes(name)) throw Error(`Cannot register native plugin with name '${name}', it conflicts with internal plugin names.`);
|
16015
|
-
return base_create(name, resolve, affectedHooks);
|
16016
|
-
},
|
16040
|
+
createNativePlugin: builtin_plugin_base.dE,
|
16017
16041
|
VirtualModulesPlugin: VirtualModulesPlugin
|
16018
16042
|
};
|
16019
16043
|
function createCompiler(userOptions) {
|
package/dist/schema/loaders.d.ts
CHANGED
@@ -116,6 +116,7 @@ export declare const getZodSwcLoaderOptionsSchema: () => z.ZodObject<{
|
|
116
116
|
"2022-03": "2022-03";
|
117
117
|
}>>;
|
118
118
|
treatConstEnumAsEnum: z.ZodOptional<z.ZodBoolean>;
|
119
|
+
tsEnumIsMutable: z.ZodOptional<z.ZodBoolean>;
|
119
120
|
useDefineForClassFields: z.ZodOptional<z.ZodBoolean>;
|
120
121
|
verbatimModuleSyntax: z.ZodOptional<z.ZodBoolean>;
|
121
122
|
}, z.core.$strict>>;
|
package/dist/worker.js
CHANGED
@@ -559,9 +559,7 @@ for(var __webpack_i__ in (()=>{
|
|
559
559
|
let memoize = (fn)=>{
|
560
560
|
let result, cache = !1, callback = fn;
|
561
561
|
return ()=>(cache || (result = callback(), cache = !0, callback = void 0), result);
|
562
|
-
}
|
563
|
-
__webpack_require__("node:fs");
|
564
|
-
let LoaderLoadingError = class extends Error {
|
562
|
+
}, LoaderLoadingError = class extends Error {
|
565
563
|
constructor(message){
|
566
564
|
super(message), this.name = "LoaderRunnerError", Error.captureStackTrace(this, this.constructor);
|
567
565
|
}
|
@@ -1,5 +1,3 @@
|
|
1
|
-
|
2
|
-
|
3
1
|
var urlBase = decodeURIComponent(__resourceQuery.slice(1));
|
4
2
|
|
5
3
|
/**
|
@@ -16,7 +14,7 @@ exports.activate = function (options) {
|
|
16
14
|
var request = (
|
17
15
|
urlBase.startsWith("https") ? require("https") : require("http")
|
18
16
|
).request(
|
19
|
-
urlBase + data,
|
17
|
+
urlBase + encodeURIComponent(data),
|
20
18
|
{
|
21
19
|
agent: false,
|
22
20
|
headers: { accept: "text/event-stream" }
|
@@ -1,5 +1,3 @@
|
|
1
|
-
|
2
|
-
|
3
1
|
if (typeof EventSource !== "function") {
|
4
2
|
throw new Error(
|
5
3
|
"Environment doesn't support lazy compilation (requires EventSource)"
|
@@ -16,7 +14,10 @@ var updateEventSource = function updateEventSource() {
|
|
16
14
|
if (activeEventSource) activeEventSource.close();
|
17
15
|
if (compiling.size) {
|
18
16
|
activeEventSource = new EventSource(
|
19
|
-
urlBase +
|
17
|
+
urlBase +
|
18
|
+
Array.from(compiling, function (module) {
|
19
|
+
return encodeURIComponent(module);
|
20
|
+
}).join("@")
|
20
21
|
);
|
21
22
|
/**
|
22
23
|
* @this {EventSource}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@rspack/core",
|
3
|
-
"version": "1.5.
|
3
|
+
"version": "1.5.1",
|
4
4
|
"webpackVersion": "5.75.0",
|
5
5
|
"license": "MIT",
|
6
6
|
"description": "The fast Rust-based web bundler with webpack-compatible API",
|
@@ -60,7 +60,7 @@
|
|
60
60
|
"dependencies": {
|
61
61
|
"@module-federation/runtime-tools": "0.18.0",
|
62
62
|
"@rspack/lite-tapable": "1.0.1",
|
63
|
-
"@rspack/binding": "1.5.
|
63
|
+
"@rspack/binding": "1.5.1"
|
64
64
|
},
|
65
65
|
"peerDependencies": {
|
66
66
|
"@swc/helpers": ">=0.5.1"
|
package/dist/util/require.d.ts
DELETED