@rspack/core 1.3.0-beta.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ChunkGraph.d.ts +1 -1
- package/dist/Watching.d.ts +4 -1
- package/dist/builtin-plugin/APIPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ArrayPushCallbackChunkFormatPlugin.d.ts +1 -1
- package/dist/builtin-plugin/AssetModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/AsyncWebAssemblyModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/BannerPlugin.d.ts +1 -1
- package/dist/builtin-plugin/BundlerInfoRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ChunkPrefetchPreloadPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CircularDependencyRspackPlugin.d.ts +59 -0
- package/dist/builtin-plugin/CommonJsChunkFormatPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ContextReplacementPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CopyRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CssModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DataUriPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DefinePlugin.d.ts +1 -1
- package/dist/builtin-plugin/DllEntryPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DllReferenceAgencyPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ElectronTargetPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EnableChunkLoadingPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EnableWasmLoadingPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EnsureChunkConditionsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EntryPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EvalDevToolModulePlugin.d.ts +1 -1
- package/dist/builtin-plugin/EvalSourceMapDevToolPlugin.d.ts +1 -1
- package/dist/builtin-plugin/FetchCompileAsyncWasmPlugin.d.ts +1 -1
- package/dist/builtin-plugin/FileUriPlugin.d.ts +1 -1
- package/dist/builtin-plugin/FlagAllModulesAsUsedPlugin.d.ts +1 -1
- package/dist/builtin-plugin/FlagDependencyExportsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/HttpExternalsRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/HttpUriPlugin.d.ts +36 -0
- package/dist/builtin-plugin/IgnorePlugin.d.ts +1 -1
- package/dist/builtin-plugin/InferAsyncModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/JsLoaderRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/JsonModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/LibManifestPlugin.d.ts +1 -1
- package/dist/builtin-plugin/LightningCssMinimizerRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/LimitChunkCountPlugin.d.ts +1 -1
- package/dist/builtin-plugin/MergeDuplicateChunksPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ModuleChunkFormatPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ModuleInfoHeaderPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NamedChunkIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NamedModuleIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NoEmitOnErrorsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NodeTargetPlugin.d.ts +1 -1
- package/dist/builtin-plugin/OccurrenceChunkIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ProgressPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ProvidePlugin.d.ts +1 -1
- package/dist/builtin-plugin/RealContentHashPlugin.d.ts +1 -1
- package/dist/builtin-plugin/RemoveDuplicateModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/RemoveEmptyChunksPlugin.d.ts +1 -1
- package/dist/builtin-plugin/RsdoctorPlugin.d.ts +1 -1
- package/dist/builtin-plugin/RuntimeChunkPlugin.d.ts +1 -1
- package/dist/builtin-plugin/RuntimePlugin.d.ts +1 -1
- package/dist/builtin-plugin/SideEffectsFlagPlugin.d.ts +1 -1
- package/dist/builtin-plugin/SizeLimitsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/SourceMapDevToolPlugin.d.ts +1 -1
- package/dist/builtin-plugin/SubresourceIntegrityPlugin.d.ts +1 -1
- package/dist/builtin-plugin/SwcJsMinimizerPlugin.d.ts +1 -1
- package/dist/builtin-plugin/WarnCaseSensitiveModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/base.d.ts +1 -1
- package/dist/builtin-plugin/html-plugin/plugin.d.ts +1 -1
- package/dist/builtin-plugin/index.d.ts +3 -1
- package/dist/builtin-plugin/lazy-compilation/lazyCompilation.d.ts +1 -1
- package/dist/builtin-plugin/lazy-compilation/middleware.d.ts +4 -0
- package/dist/config/normalization.d.ts +2 -0
- package/dist/config/types.d.ts +19 -6
- package/dist/config/zod.d.ts +457 -511
- package/dist/container/ModuleFederationRuntimePlugin.d.ts +1 -1
- package/dist/cssExtractLoader.js +1 -1
- package/dist/exports.d.ts +4 -1
- package/dist/index.js +503 -527
- package/dist/stats/statsFactoryUtils.d.ts +8 -8
- package/dist/util/MergeCaller.d.ts +1 -0
- package/hot/lazy-compilation-node.js +5 -1
- package/hot/lazy-compilation-web.js +6 -10
- package/package.json +6 -6
- package/dist/builtin-plugin/lazy-compilation/backend.d.ts +0 -52
- package/dist/builtin-plugin/lazy-compilation/plugin.d.ts +0 -13
package/dist/index.js
CHANGED
@@ -148,15 +148,15 @@ var require_CachedInputFileSystem = __commonJS({
|
|
148
148
|
"../../node_modules/.pnpm/enhanced-resolve@5.18.1/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js"(exports2, module2) {
|
149
149
|
"use strict";
|
150
150
|
var nextTick = require("process").nextTick;
|
151
|
-
var dirname4 = (
|
152
|
-
let idx =
|
151
|
+
var dirname4 = (path12) => {
|
152
|
+
let idx = path12.length - 1;
|
153
153
|
while (idx >= 0) {
|
154
|
-
const c =
|
154
|
+
const c = path12.charCodeAt(idx);
|
155
155
|
if (c === 47 || c === 92) break;
|
156
156
|
idx--;
|
157
157
|
}
|
158
158
|
if (idx < 0) return "";
|
159
|
-
return
|
159
|
+
return path12.slice(0, idx);
|
160
160
|
};
|
161
161
|
var runCallbacks = (callbacks, err, result2) => {
|
162
162
|
if (callbacks.length === 1) {
|
@@ -193,13 +193,13 @@ var require_CachedInputFileSystem = __commonJS({
|
|
193
193
|
* @param {FileSystemCallback<any>=} callback callback
|
194
194
|
* @returns {any} result
|
195
195
|
*/
|
196
|
-
(
|
196
|
+
(path12, options, callback) => {
|
197
197
|
if (typeof options === "function") {
|
198
198
|
callback = /** @type {FileSystemCallback<any>} */
|
199
199
|
options;
|
200
200
|
options = void 0;
|
201
201
|
}
|
202
|
-
if (typeof
|
202
|
+
if (typeof path12 !== "string" && !Buffer.isBuffer(path12) && !(path12 instanceof URL) && typeof path12 !== "number") {
|
203
203
|
callback(
|
204
204
|
new TypeError("path must be a string, Buffer, URL or number")
|
205
205
|
);
|
@@ -210,26 +210,26 @@ var require_CachedInputFileSystem = __commonJS({
|
|
210
210
|
/** @type {Function} */
|
211
211
|
this._provider.call(
|
212
212
|
this._providerContext,
|
213
|
-
|
213
|
+
path12,
|
214
214
|
options,
|
215
215
|
callback
|
216
216
|
)
|
217
217
|
);
|
218
218
|
}
|
219
|
-
let callbacks = this._activeAsyncOperations.get(
|
219
|
+
let callbacks = this._activeAsyncOperations.get(path12);
|
220
220
|
if (callbacks) {
|
221
221
|
callbacks.push(callback);
|
222
222
|
return;
|
223
223
|
}
|
224
|
-
this._activeAsyncOperations.set(
|
224
|
+
this._activeAsyncOperations.set(path12, callbacks = [callback]);
|
225
225
|
provider(
|
226
|
-
|
226
|
+
path12,
|
227
227
|
/**
|
228
228
|
* @param {Error} err error
|
229
229
|
* @param {any} result result
|
230
230
|
*/
|
231
231
|
(err, result2) => {
|
232
|
-
this._activeAsyncOperations.delete(
|
232
|
+
this._activeAsyncOperations.delete(path12);
|
233
233
|
runCallbacks(callbacks, err, result2);
|
234
234
|
}
|
235
235
|
);
|
@@ -241,12 +241,12 @@ var require_CachedInputFileSystem = __commonJS({
|
|
241
241
|
* @param {object=} options options
|
242
242
|
* @returns {any} result
|
243
243
|
*/
|
244
|
-
(
|
244
|
+
(path12, options) => {
|
245
245
|
return (
|
246
246
|
/** @type {Function} */
|
247
247
|
this._syncProvider.call(
|
248
248
|
this._providerContext,
|
249
|
-
|
249
|
+
path12,
|
250
250
|
options
|
251
251
|
)
|
252
252
|
);
|
@@ -292,22 +292,22 @@ var require_CachedInputFileSystem = __commonJS({
|
|
292
292
|
* @param {FileSystemCallback<any>} callback callback
|
293
293
|
* @returns {void}
|
294
294
|
*/
|
295
|
-
provide(
|
295
|
+
provide(path12, options, callback) {
|
296
296
|
if (typeof options === "function") {
|
297
297
|
callback = options;
|
298
298
|
options = void 0;
|
299
299
|
}
|
300
|
-
if (typeof
|
300
|
+
if (typeof path12 !== "string" && !Buffer.isBuffer(path12) && !(path12 instanceof URL) && typeof path12 !== "number") {
|
301
301
|
callback(new TypeError("path must be a string, Buffer, URL or number"));
|
302
302
|
return;
|
303
303
|
}
|
304
|
-
const strPath = typeof
|
304
|
+
const strPath = typeof path12 !== "string" ? path12.toString() : path12;
|
305
305
|
if (options) {
|
306
306
|
return (
|
307
307
|
/** @type {Function} */
|
308
308
|
this._provider.call(
|
309
309
|
this._providerContext,
|
310
|
-
|
310
|
+
path12,
|
311
311
|
options,
|
312
312
|
callback
|
313
313
|
)
|
@@ -329,7 +329,7 @@ var require_CachedInputFileSystem = __commonJS({
|
|
329
329
|
this._activeAsyncOperations.set(strPath, callbacks = [callback]);
|
330
330
|
this._provider.call(
|
331
331
|
this._providerContext,
|
332
|
-
|
332
|
+
path12,
|
333
333
|
/**
|
334
334
|
* @param {Error | null} err error
|
335
335
|
* @param {any} [result] result
|
@@ -352,17 +352,17 @@ var require_CachedInputFileSystem = __commonJS({
|
|
352
352
|
* @param {any} options options
|
353
353
|
* @returns {any} result
|
354
354
|
*/
|
355
|
-
provideSync(
|
356
|
-
if (typeof
|
355
|
+
provideSync(path12, options) {
|
356
|
+
if (typeof path12 !== "string" && !Buffer.isBuffer(path12) && !(path12 instanceof URL) && typeof path12 !== "number") {
|
357
357
|
throw new TypeError("path must be a string");
|
358
358
|
}
|
359
|
-
const strPath = typeof
|
359
|
+
const strPath = typeof path12 !== "string" ? path12.toString() : path12;
|
360
360
|
if (options) {
|
361
361
|
return (
|
362
362
|
/** @type {Function} */
|
363
363
|
this._syncProvider.call(
|
364
364
|
this._providerContext,
|
365
|
-
|
365
|
+
path12,
|
366
366
|
options
|
367
367
|
)
|
368
368
|
);
|
@@ -382,7 +382,7 @@ var require_CachedInputFileSystem = __commonJS({
|
|
382
382
|
result2 = /** @type {Function} */
|
383
383
|
this._syncProvider.call(
|
384
384
|
this._providerContext,
|
385
|
-
|
385
|
+
path12
|
386
386
|
);
|
387
387
|
} catch (err) {
|
388
388
|
this._storeResult(
|
@@ -471,11 +471,11 @@ var require_CachedInputFileSystem = __commonJS({
|
|
471
471
|
* @param {Error | null} err error
|
472
472
|
* @param {any} result result
|
473
473
|
*/
|
474
|
-
_storeResult(
|
475
|
-
if (this._data.has(
|
474
|
+
_storeResult(path12, err, result2) {
|
475
|
+
if (this._data.has(path12)) return;
|
476
476
|
const level = this._levels[this._currentLevel];
|
477
|
-
this._data.set(
|
478
|
-
level.add(
|
477
|
+
this._data.set(path12, { err, result: result2, level });
|
478
|
+
level.add(path12);
|
479
479
|
}
|
480
480
|
_decayLevel() {
|
481
481
|
const nextLevel = (this._currentLevel + 1) % this._levels.length;
|
@@ -610,8 +610,8 @@ var require_CachedInputFileSystem = __commonJS({
|
|
610
610
|
* @param {string} path path
|
611
611
|
* @param {FileSystemCallback<any>} callback
|
612
612
|
*/
|
613
|
-
((
|
614
|
-
this.readFile(
|
613
|
+
((path12, callback) => {
|
614
|
+
this.readFile(path12, (err, buffer) => {
|
615
615
|
if (err) return callback(err);
|
616
616
|
if (!buffer || buffer.length === 0)
|
617
617
|
return callback(new Error("No file content"));
|
@@ -632,8 +632,8 @@ var require_CachedInputFileSystem = __commonJS({
|
|
632
632
|
* @param {string} path path
|
633
633
|
* @returns {any} result
|
634
634
|
*/
|
635
|
-
((
|
636
|
-
const buffer = this.readFileSync(
|
635
|
+
((path12) => {
|
636
|
+
const buffer = this.readFileSync(path12);
|
637
637
|
const data = JSON.parse(buffer.toString("utf-8"));
|
638
638
|
return data;
|
639
639
|
}),
|
@@ -689,27 +689,28 @@ var require_CachedInputFileSystem = __commonJS({
|
|
689
689
|
// src/index.ts
|
690
690
|
var index_exports = {};
|
691
691
|
__export(index_exports, {
|
692
|
-
AsyncDependenciesBlock: () =>
|
692
|
+
AsyncDependenciesBlock: () => import_binding90.AsyncDependenciesBlock,
|
693
693
|
BannerPlugin: () => BannerPlugin,
|
694
|
+
CircularDependencyRspackPlugin: () => CircularDependencyRspackPlugin,
|
694
695
|
Compilation: () => Compilation,
|
695
696
|
Compiler: () => Compiler,
|
696
|
-
ConcatenatedModule: () =>
|
697
|
-
ContextModule: () =>
|
697
|
+
ConcatenatedModule: () => import_binding81.ConcatenatedModule,
|
698
|
+
ContextModule: () => import_binding80.ContextModule,
|
698
699
|
ContextReplacementPlugin: () => ContextReplacementPlugin,
|
699
700
|
CopyRspackPlugin: () => CopyRspackPlugin,
|
700
701
|
CssExtractRspackPlugin: () => CssExtractRspackPlugin,
|
701
702
|
DefinePlugin: () => DefinePlugin,
|
702
|
-
Dependency: () =>
|
703
|
+
Dependency: () => import_binding90.Dependency,
|
703
704
|
DllPlugin: () => DllPlugin,
|
704
705
|
DllReferencePlugin: () => DllReferencePlugin,
|
705
706
|
DynamicEntryPlugin: () => DynamicEntryPlugin,
|
706
|
-
EntryDependency: () =>
|
707
|
+
EntryDependency: () => import_binding90.EntryDependency,
|
707
708
|
EntryOptionPlugin: () => EntryOptionPlugin_default,
|
708
709
|
EntryPlugin: () => EntryPlugin,
|
709
710
|
EnvironmentPlugin: () => EnvironmentPlugin,
|
710
711
|
EvalDevToolModulePlugin: () => EvalDevToolModulePlugin,
|
711
712
|
EvalSourceMapDevToolPlugin: () => EvalSourceMapDevToolPlugin,
|
712
|
-
ExternalModule: () =>
|
713
|
+
ExternalModule: () => import_binding82.ExternalModule,
|
713
714
|
ExternalsPlugin: () => ExternalsPlugin,
|
714
715
|
HotModuleReplacementPlugin: () => HotModuleReplacementPlugin,
|
715
716
|
HtmlRspackPlugin: () => HtmlRspackPlugin,
|
@@ -761,27 +762,28 @@ module.exports = __toCommonJS(index_exports);
|
|
761
762
|
// src/exports.ts
|
762
763
|
var exports_exports = {};
|
763
764
|
__export(exports_exports, {
|
764
|
-
AsyncDependenciesBlock: () =>
|
765
|
+
AsyncDependenciesBlock: () => import_binding90.AsyncDependenciesBlock,
|
765
766
|
BannerPlugin: () => BannerPlugin,
|
767
|
+
CircularDependencyRspackPlugin: () => CircularDependencyRspackPlugin,
|
766
768
|
Compilation: () => Compilation,
|
767
769
|
Compiler: () => Compiler,
|
768
|
-
ConcatenatedModule: () =>
|
769
|
-
ContextModule: () =>
|
770
|
+
ConcatenatedModule: () => import_binding81.ConcatenatedModule,
|
771
|
+
ContextModule: () => import_binding80.ContextModule,
|
770
772
|
ContextReplacementPlugin: () => ContextReplacementPlugin,
|
771
773
|
CopyRspackPlugin: () => CopyRspackPlugin,
|
772
774
|
CssExtractRspackPlugin: () => CssExtractRspackPlugin,
|
773
775
|
DefinePlugin: () => DefinePlugin,
|
774
|
-
Dependency: () =>
|
776
|
+
Dependency: () => import_binding90.Dependency,
|
775
777
|
DllPlugin: () => DllPlugin,
|
776
778
|
DllReferencePlugin: () => DllReferencePlugin,
|
777
779
|
DynamicEntryPlugin: () => DynamicEntryPlugin,
|
778
|
-
EntryDependency: () =>
|
780
|
+
EntryDependency: () => import_binding90.EntryDependency,
|
779
781
|
EntryOptionPlugin: () => EntryOptionPlugin_default,
|
780
782
|
EntryPlugin: () => EntryPlugin,
|
781
783
|
EnvironmentPlugin: () => EnvironmentPlugin,
|
782
784
|
EvalDevToolModulePlugin: () => EvalDevToolModulePlugin,
|
783
785
|
EvalSourceMapDevToolPlugin: () => EvalSourceMapDevToolPlugin,
|
784
|
-
ExternalModule: () =>
|
786
|
+
ExternalModule: () => import_binding82.ExternalModule,
|
785
787
|
ExternalsPlugin: () => ExternalsPlugin,
|
786
788
|
HotModuleReplacementPlugin: () => HotModuleReplacementPlugin,
|
787
789
|
HtmlRspackPlugin: () => HtmlRspackPlugin,
|
@@ -2471,6 +2473,9 @@ var MergeCaller = class {
|
|
2471
2473
|
};
|
2472
2474
|
this.callFn = fn2;
|
2473
2475
|
}
|
2476
|
+
pendingData() {
|
2477
|
+
return this.callArgs;
|
2478
|
+
}
|
2474
2479
|
push(...data) {
|
2475
2480
|
if (this.callArgs.length === 0) {
|
2476
2481
|
queueMicrotask(this.finalCall);
|
@@ -2484,13 +2489,13 @@ function createFakeCompilationDependencies(getDeps, addDeps) {
|
|
2484
2489
|
const addDepsCaller = new MergeCaller(addDeps);
|
2485
2490
|
return {
|
2486
2491
|
*[Symbol.iterator]() {
|
2487
|
-
const deps = getDeps();
|
2492
|
+
const deps = /* @__PURE__ */ new Set([...getDeps(), ...addDepsCaller.pendingData()]);
|
2488
2493
|
for (const dep of deps) {
|
2489
2494
|
yield dep;
|
2490
2495
|
}
|
2491
2496
|
},
|
2492
2497
|
has(dep) {
|
2493
|
-
return getDeps().includes(dep);
|
2498
|
+
return addDepsCaller.pendingData().includes(dep) || getDeps().includes(dep);
|
2494
2499
|
},
|
2495
2500
|
add: (dep) => {
|
2496
2501
|
addDepsCaller.push(dep);
|
@@ -5356,7 +5361,7 @@ var LoaderObject = class {
|
|
5356
5361
|
constructor(loaderItem, compiler) {
|
5357
5362
|
const {
|
5358
5363
|
request,
|
5359
|
-
path:
|
5364
|
+
path: path12,
|
5360
5365
|
query,
|
5361
5366
|
fragment,
|
5362
5367
|
options,
|
@@ -5367,7 +5372,7 @@ var LoaderObject = class {
|
|
5367
5372
|
type
|
5368
5373
|
} = createLoaderObject(loaderItem, compiler);
|
5369
5374
|
this.request = request;
|
5370
|
-
this.path =
|
5375
|
+
this.path = path12;
|
5371
5376
|
this.query = query;
|
5372
5377
|
this.fragment = fragment;
|
5373
5378
|
this.options = options;
|
@@ -5494,17 +5499,17 @@ var runSyncOrAsync = (0, import_node_util4.promisify)(function runSyncOrAsync2(f
|
|
5494
5499
|
callback(e, []);
|
5495
5500
|
}
|
5496
5501
|
});
|
5497
|
-
function dirname2(
|
5498
|
-
if (
|
5499
|
-
const i =
|
5500
|
-
const j =
|
5501
|
-
const i2 =
|
5502
|
-
const j2 =
|
5502
|
+
function dirname2(path12) {
|
5503
|
+
if (path12 === "/") return "/";
|
5504
|
+
const i = path12.lastIndexOf("/");
|
5505
|
+
const j = path12.lastIndexOf("\\");
|
5506
|
+
const i2 = path12.indexOf("/");
|
5507
|
+
const j2 = path12.indexOf("\\");
|
5503
5508
|
const idx = i > j ? i : j;
|
5504
5509
|
const idx2 = i > j ? i2 : j2;
|
5505
|
-
if (idx < 0) return
|
5506
|
-
if (idx === idx2) return
|
5507
|
-
return
|
5510
|
+
if (idx < 0) return path12;
|
5511
|
+
if (idx === idx2) return path12.slice(0, idx + 1);
|
5512
|
+
return path12.slice(0, idx);
|
5508
5513
|
}
|
5509
5514
|
function getCurrentLoader(loaderContext, index = loaderContext.loaderIndex) {
|
5510
5515
|
var _a;
|
@@ -6030,10 +6035,10 @@ function parsePathQueryFragment(str) {
|
|
6030
6035
|
|
6031
6036
|
// src/config/adapterRuleUse.ts
|
6032
6037
|
var BUILTIN_LOADER_PREFIX = "builtin:";
|
6033
|
-
function createRawModuleRuleUses(uses,
|
6038
|
+
function createRawModuleRuleUses(uses, path12, options) {
|
6034
6039
|
const normalizeRuleSetUseItem = (item) => typeof item === "string" ? { loader: item } : item;
|
6035
6040
|
const allUses = Array.isArray(uses) ? [...uses].map(normalizeRuleSetUseItem) : [normalizeRuleSetUseItem(uses)];
|
6036
|
-
return createRawModuleRuleUsesImpl(allUses,
|
6041
|
+
return createRawModuleRuleUsesImpl(allUses, path12, options);
|
6037
6042
|
}
|
6038
6043
|
var getSwcLoaderOptions = (options, _) => {
|
6039
6044
|
if (options && typeof options === "object") {
|
@@ -6074,7 +6079,7 @@ function getBuiltinLoaderOptions(identifier, o, options) {
|
|
6074
6079
|
}
|
6075
6080
|
return o;
|
6076
6081
|
}
|
6077
|
-
function createRawModuleRuleUsesImpl(uses,
|
6082
|
+
function createRawModuleRuleUsesImpl(uses, path12, options) {
|
6078
6083
|
if (!uses.length) {
|
6079
6084
|
return [];
|
6080
6085
|
}
|
@@ -6089,7 +6094,7 @@ function createRawModuleRuleUsesImpl(uses, path11, options) {
|
|
6089
6094
|
return {
|
6090
6095
|
loader: resolveStringifyLoaders(
|
6091
6096
|
use,
|
6092
|
-
`${
|
6097
|
+
`${path12}[${index}]`,
|
6093
6098
|
options.compiler,
|
6094
6099
|
isBuiltin
|
6095
6100
|
),
|
@@ -6097,7 +6102,7 @@ function createRawModuleRuleUsesImpl(uses, path11, options) {
|
|
6097
6102
|
};
|
6098
6103
|
});
|
6099
6104
|
}
|
6100
|
-
function resolveStringifyLoaders(use,
|
6105
|
+
function resolveStringifyLoaders(use, path12, compiler, isBuiltin) {
|
6101
6106
|
const obj = parsePathQueryFragment(use.loader);
|
6102
6107
|
let ident = null;
|
6103
6108
|
if (use.options === null) {
|
@@ -6106,7 +6111,7 @@ function resolveStringifyLoaders(use, path11, compiler, isBuiltin) {
|
|
6106
6111
|
else if (use.ident) obj.query = `??${ident = use.ident}`;
|
6107
6112
|
else if (typeof use.options === "object" && use.options.ident)
|
6108
6113
|
obj.query = `??${ident = use.options.ident}`;
|
6109
|
-
else if (typeof use.options === "object") obj.query = `??${ident =
|
6114
|
+
else if (typeof use.options === "object") obj.query = `??${ident = path12}`;
|
6110
6115
|
else obj.query = `?${JSON.stringify(use.options)}`;
|
6111
6116
|
if (use.options && typeof use.options === "object") {
|
6112
6117
|
if (!ident) ident = "[[missing ident]]";
|
@@ -6193,10 +6198,13 @@ function getRawExtensionAlias(alias = {}) {
|
|
6193
6198
|
return Object.fromEntries(entries);
|
6194
6199
|
}
|
6195
6200
|
function getRawAlias(alias = {}) {
|
6196
|
-
|
6197
|
-
|
6198
|
-
|
6199
|
-
|
6201
|
+
if (typeof alias === "object" && alias !== null && !Array.isArray(alias)) {
|
6202
|
+
return Object.entries(alias).map(([key, value]) => ({
|
6203
|
+
path: key,
|
6204
|
+
redirect: Array.isArray(value) ? value : [value]
|
6205
|
+
}));
|
6206
|
+
}
|
6207
|
+
return false;
|
6200
6208
|
}
|
6201
6209
|
function getRawResolveByDependency(byDependency) {
|
6202
6210
|
if (byDependency === void 0) return byDependency;
|
@@ -6272,7 +6280,7 @@ function tryMatch(payload, condition) {
|
|
6272
6280
|
}
|
6273
6281
|
return false;
|
6274
6282
|
}
|
6275
|
-
var getRawModuleRule = (rule,
|
6283
|
+
var getRawModuleRule = (rule, path12, options, upperType) => {
|
6276
6284
|
if (rule.loader) {
|
6277
6285
|
rule.use = [
|
6278
6286
|
{
|
@@ -6290,7 +6298,7 @@ var getRawModuleRule = (rule, path11, options, upperType) => {
|
|
6290
6298
|
compiler: options.compiler
|
6291
6299
|
};
|
6292
6300
|
const uses = use(context2);
|
6293
|
-
return createRawModuleRuleUses(uses ?? [], `${
|
6301
|
+
return createRawModuleRuleUses(uses ?? [], `${path12}.use`, options);
|
6294
6302
|
};
|
6295
6303
|
}
|
6296
6304
|
const rawModuleRule = {
|
@@ -6318,7 +6326,7 @@ var getRawModuleRule = (rule, path11, options, upperType) => {
|
|
6318
6326
|
scheme: rule.scheme ? getRawRuleSetCondition(rule.scheme) : void 0,
|
6319
6327
|
mimetype: rule.mimetype ? getRawRuleSetCondition(rule.mimetype) : void 0,
|
6320
6328
|
sideEffects: rule.sideEffects,
|
6321
|
-
use: typeof rule.use === "function" ? funcUse : createRawModuleRuleUses(rule.use ?? [], `${
|
6329
|
+
use: typeof rule.use === "function" ? funcUse : createRawModuleRuleUses(rule.use ?? [], `${path12}.use`, options),
|
6322
6330
|
type: rule.type,
|
6323
6331
|
layer: rule.layer,
|
6324
6332
|
parser: rule.parser ? getRawParserOptions(rule.parser, rule.type ?? upperType) : void 0,
|
@@ -6327,7 +6335,7 @@ var getRawModuleRule = (rule, path11, options, upperType) => {
|
|
6327
6335
|
oneOf: rule.oneOf ? rule.oneOf.filter(Boolean).map(
|
6328
6336
|
(rule2, index) => getRawModuleRule(
|
6329
6337
|
rule2,
|
6330
|
-
`${
|
6338
|
+
`${path12}.oneOf[${index}]`,
|
6331
6339
|
options,
|
6332
6340
|
rule2.type ?? upperType
|
6333
6341
|
)
|
@@ -6335,7 +6343,7 @@ var getRawModuleRule = (rule, path11, options, upperType) => {
|
|
6335
6343
|
rules: rule.rules ? rule.rules.filter(Boolean).map(
|
6336
6344
|
(rule2, index) => getRawModuleRule(
|
6337
6345
|
rule2,
|
6338
|
-
`${
|
6346
|
+
`${path12}.rules[${index}]`,
|
6339
6347
|
options,
|
6340
6348
|
rule2.type ?? upperType
|
6341
6349
|
)
|
@@ -6349,11 +6357,11 @@ var getRawModuleRule = (rule, path11, options, upperType) => {
|
|
6349
6357
|
delete rawModuleRule.resourceFragment;
|
6350
6358
|
rawModuleRule.rspackResource = getRawRuleSetCondition(
|
6351
6359
|
(resourceQueryFragment) => {
|
6352
|
-
const { path:
|
6353
|
-
if (rule.test && !tryMatch(
|
6360
|
+
const { path: path13, query, fragment } = parseResource(resourceQueryFragment);
|
6361
|
+
if (rule.test && !tryMatch(path13, rule.test)) {
|
6354
6362
|
return false;
|
6355
6363
|
}
|
6356
|
-
if (rule.resource && !tryMatch(
|
6364
|
+
if (rule.resource && !tryMatch(path13, rule.resource)) {
|
6357
6365
|
return false;
|
6358
6366
|
}
|
6359
6367
|
if (rule.resourceQuery && !tryMatch(query, rule.resourceQuery)) {
|
@@ -6475,7 +6483,7 @@ function getRawParserOptions(parser, type) {
|
|
6475
6483
|
json: getRawJsonParserOptions(parser)
|
6476
6484
|
};
|
6477
6485
|
}
|
6478
|
-
throw new Error(`unreachable:
|
6486
|
+
throw new Error(`unreachable: unknown module type: ${type}`);
|
6479
6487
|
}
|
6480
6488
|
function getRawJavascriptParserOptions(parser) {
|
6481
6489
|
var _a, _b, _c;
|
@@ -6663,7 +6671,7 @@ function getRawStats(stats) {
|
|
6663
6671
|
// src/config/defaults.ts
|
6664
6672
|
var import_node_assert6 = __toESM(require("assert"));
|
6665
6673
|
var import_node_fs3 = __toESM(require("fs"));
|
6666
|
-
var
|
6674
|
+
var import_node_path10 = __toESM(require("path"));
|
6667
6675
|
|
6668
6676
|
// src/ModuleTypeConstants.ts
|
6669
6677
|
var JSON_MODULE_TYPE = "json";
|
@@ -6954,26 +6962,45 @@ var BundlerInfoRspackPlugin = create2(
|
|
6954
6962
|
}
|
6955
6963
|
);
|
6956
6964
|
|
6957
|
-
// src/builtin-plugin/
|
6965
|
+
// src/builtin-plugin/CircularDependencyRspackPlugin.ts
|
6958
6966
|
var import_binding11 = require("@rspack/binding");
|
6967
|
+
var CircularDependencyRspackPlugin = create2(
|
6968
|
+
import_binding11.BuiltinPluginName.CircularDependencyRspackPlugin,
|
6969
|
+
(options) => {
|
6970
|
+
return {
|
6971
|
+
allowAsyncCycles: options.allowAsyncCycles,
|
6972
|
+
failOnError: options.failOnError,
|
6973
|
+
exclude: options.exclude,
|
6974
|
+
ignoredConnections: options.ignoredConnections,
|
6975
|
+
onDetected: options.onDetected,
|
6976
|
+
onIgnored: options.onIgnored,
|
6977
|
+
onStart: options.onStart,
|
6978
|
+
onEnd: options.onEnd
|
6979
|
+
};
|
6980
|
+
},
|
6981
|
+
"compilation"
|
6982
|
+
);
|
6983
|
+
|
6984
|
+
// src/builtin-plugin/ChunkPrefetchPreloadPlugin.ts
|
6985
|
+
var import_binding12 = require("@rspack/binding");
|
6959
6986
|
var ChunkPrefetchPreloadPlugin = create2(
|
6960
|
-
|
6987
|
+
import_binding12.BuiltinPluginName.ChunkPrefetchPreloadPlugin,
|
6961
6988
|
() => {
|
6962
6989
|
}
|
6963
6990
|
);
|
6964
6991
|
|
6965
6992
|
// src/builtin-plugin/CommonJsChunkFormatPlugin.ts
|
6966
|
-
var
|
6993
|
+
var import_binding13 = require("@rspack/binding");
|
6967
6994
|
var CommonJsChunkFormatPlugin = create2(
|
6968
|
-
|
6995
|
+
import_binding13.BuiltinPluginName.CommonJsChunkFormatPlugin,
|
6969
6996
|
() => {
|
6970
6997
|
}
|
6971
6998
|
);
|
6972
6999
|
|
6973
7000
|
// src/builtin-plugin/CopyRspackPlugin.ts
|
6974
|
-
var
|
7001
|
+
var import_binding14 = require("@rspack/binding");
|
6975
7002
|
var CopyRspackPlugin = create2(
|
6976
|
-
|
7003
|
+
import_binding14.BuiltinPluginName.CopyRspackPlugin,
|
6977
7004
|
(copy) => {
|
6978
7005
|
const ret = {
|
6979
7006
|
patterns: []
|
@@ -6994,7 +7021,7 @@ var CopyRspackPlugin = create2(
|
|
6994
7021
|
);
|
6995
7022
|
|
6996
7023
|
// src/builtin-plugin/css-extract/index.ts
|
6997
|
-
var
|
7024
|
+
var import_binding15 = require("@rspack/binding");
|
6998
7025
|
var import_node_path5 = require("path");
|
6999
7026
|
|
7000
7027
|
// src/builtin-plugin/css-extract/loader.ts
|
@@ -7030,7 +7057,7 @@ var CssExtractRspackPlugin = class {
|
|
7030
7057
|
this.options.pathinfo = true;
|
7031
7058
|
}
|
7032
7059
|
compiler.__internal__registerBuiltinPlugin({
|
7033
|
-
name:
|
7060
|
+
name: import_binding15.BuiltinPluginName.CssExtractRspackPlugin,
|
7034
7061
|
options: this.normalizeOptions(this.options)
|
7035
7062
|
});
|
7036
7063
|
}
|
@@ -7089,27 +7116,27 @@ CssExtractRspackPlugin.pluginName = PLUGIN_NAME;
|
|
7089
7116
|
CssExtractRspackPlugin.loader = LOADER_PATH;
|
7090
7117
|
|
7091
7118
|
// src/builtin-plugin/CssModulesPlugin.ts
|
7092
|
-
var
|
7119
|
+
var import_binding16 = require("@rspack/binding");
|
7093
7120
|
var CssModulesPlugin = create2(
|
7094
|
-
|
7121
|
+
import_binding16.BuiltinPluginName.CssModulesPlugin,
|
7095
7122
|
() => {
|
7096
7123
|
},
|
7097
7124
|
"compilation"
|
7098
7125
|
);
|
7099
7126
|
|
7100
7127
|
// src/builtin-plugin/DataUriPlugin.ts
|
7101
|
-
var
|
7128
|
+
var import_binding17 = require("@rspack/binding");
|
7102
7129
|
var DataUriPlugin = create2(
|
7103
|
-
|
7130
|
+
import_binding17.BuiltinPluginName.DataUriPlugin,
|
7104
7131
|
() => {
|
7105
7132
|
},
|
7106
7133
|
"compilation"
|
7107
7134
|
);
|
7108
7135
|
|
7109
7136
|
// src/builtin-plugin/DefinePlugin.ts
|
7110
|
-
var
|
7137
|
+
var import_binding18 = require("@rspack/binding");
|
7111
7138
|
var DefinePlugin = create2(
|
7112
|
-
|
7139
|
+
import_binding18.BuiltinPluginName.DefinePlugin,
|
7113
7140
|
function(define) {
|
7114
7141
|
var _a;
|
7115
7142
|
const supportsBigIntLiteral = ((_a = this.options.output.environment) == null ? void 0 : _a.bigIntLiteral) ?? false;
|
@@ -7153,11 +7180,11 @@ var normalizeValue = (define, supportsBigIntLiteral) => {
|
|
7153
7180
|
};
|
7154
7181
|
|
7155
7182
|
// src/builtin-plugin/DeterministicChunkIdsPlugin.ts
|
7156
|
-
var
|
7183
|
+
var import_binding19 = require("@rspack/binding");
|
7157
7184
|
var DeterministicChunkIdsPlugin = class extends RspackBuiltinPlugin {
|
7158
7185
|
constructor() {
|
7159
7186
|
super(...arguments);
|
7160
|
-
this.name =
|
7187
|
+
this.name = import_binding19.BuiltinPluginName.DeterministicChunkIdsPlugin;
|
7161
7188
|
this.affectedHooks = "compilation";
|
7162
7189
|
}
|
7163
7190
|
raw(compiler) {
|
@@ -7176,11 +7203,11 @@ var DeterministicChunkIdsPlugin = class extends RspackBuiltinPlugin {
|
|
7176
7203
|
};
|
7177
7204
|
|
7178
7205
|
// src/builtin-plugin/DeterministicModuleIdsPlugin.ts
|
7179
|
-
var
|
7206
|
+
var import_binding20 = require("@rspack/binding");
|
7180
7207
|
var DeterministicModuleIdsPlugin = class extends RspackBuiltinPlugin {
|
7181
7208
|
constructor() {
|
7182
7209
|
super(...arguments);
|
7183
|
-
this.name =
|
7210
|
+
this.name = import_binding20.BuiltinPluginName.DeterministicModuleIdsPlugin;
|
7184
7211
|
this.affectedHooks = "compilation";
|
7185
7212
|
}
|
7186
7213
|
raw(compiler) {
|
@@ -7199,7 +7226,7 @@ var DeterministicModuleIdsPlugin = class extends RspackBuiltinPlugin {
|
|
7199
7226
|
};
|
7200
7227
|
|
7201
7228
|
// src/builtin-plugin/DynamicEntryPlugin.ts
|
7202
|
-
var
|
7229
|
+
var import_binding22 = require("@rspack/binding");
|
7203
7230
|
|
7204
7231
|
// src/lib/EntryOptionPlugin.ts
|
7205
7232
|
var import_node_assert4 = __toESM(require("assert"));
|
@@ -7272,9 +7299,9 @@ var EntryOptionPlugin = class _EntryOptionPlugin {
|
|
7272
7299
|
var EntryOptionPlugin_default = EntryOptionPlugin;
|
7273
7300
|
|
7274
7301
|
// src/builtin-plugin/EntryPlugin.ts
|
7275
|
-
var
|
7302
|
+
var import_binding21 = require("@rspack/binding");
|
7276
7303
|
var OriginEntryPlugin = create2(
|
7277
|
-
|
7304
|
+
import_binding21.BuiltinPluginName.EntryPlugin,
|
7278
7305
|
(context2, entry2, options = "") => {
|
7279
7306
|
const entryOptions = typeof options === "string" ? { name: options } : options;
|
7280
7307
|
return {
|
@@ -7286,7 +7313,7 @@ var OriginEntryPlugin = create2(
|
|
7286
7313
|
"make"
|
7287
7314
|
);
|
7288
7315
|
var EntryPlugin = OriginEntryPlugin;
|
7289
|
-
EntryPlugin.createDependency = (request) => new
|
7316
|
+
EntryPlugin.createDependency = (request) => new import_binding21.EntryDependency(request);
|
7290
7317
|
function getRawEntryOptions(entry2) {
|
7291
7318
|
const runtime = entry2.runtime;
|
7292
7319
|
const chunkLoading2 = entry2.chunkLoading;
|
@@ -7310,7 +7337,7 @@ var DynamicEntryPlugin = class extends RspackBuiltinPlugin {
|
|
7310
7337
|
super();
|
7311
7338
|
this.context = context2;
|
7312
7339
|
this.entry = entry2;
|
7313
|
-
this.name =
|
7340
|
+
this.name = import_binding22.BuiltinPluginName.DynamicEntryPlugin;
|
7314
7341
|
this.affectedHooks = "make";
|
7315
7342
|
}
|
7316
7343
|
raw(compiler) {
|
@@ -7336,16 +7363,16 @@ var DynamicEntryPlugin = class extends RspackBuiltinPlugin {
|
|
7336
7363
|
};
|
7337
7364
|
|
7338
7365
|
// src/builtin-plugin/ElectronTargetPlugin.ts
|
7339
|
-
var
|
7366
|
+
var import_binding23 = require("@rspack/binding");
|
7340
7367
|
var ElectronTargetPlugin = create2(
|
7341
|
-
|
7368
|
+
import_binding23.BuiltinPluginName.ElectronTargetPlugin,
|
7342
7369
|
(context2) => context2 ?? "none"
|
7343
7370
|
);
|
7344
7371
|
|
7345
7372
|
// src/builtin-plugin/EnableChunkLoadingPlugin.ts
|
7346
|
-
var
|
7373
|
+
var import_binding24 = require("@rspack/binding");
|
7347
7374
|
var EnableChunkLoadingPluginInner = create2(
|
7348
|
-
|
7375
|
+
import_binding24.BuiltinPluginName.EnableChunkLoadingPlugin,
|
7349
7376
|
(type) => type
|
7350
7377
|
);
|
7351
7378
|
var enabledTypes = /* @__PURE__ */ new WeakMap();
|
@@ -7399,7 +7426,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
7399
7426
|
};
|
7400
7427
|
|
7401
7428
|
// src/builtin-plugin/EnableLibraryPlugin.ts
|
7402
|
-
var
|
7429
|
+
var import_binding25 = require("@rspack/binding");
|
7403
7430
|
var enabledTypes2 = /* @__PURE__ */ new WeakMap();
|
7404
7431
|
var getEnabledTypes2 = (compiler) => {
|
7405
7432
|
let set = enabledTypes2.get(compiler);
|
@@ -7413,7 +7440,7 @@ var EnableLibraryPlugin = class extends RspackBuiltinPlugin {
|
|
7413
7440
|
constructor(type) {
|
7414
7441
|
super();
|
7415
7442
|
this.type = type;
|
7416
|
-
this.name =
|
7443
|
+
this.name = import_binding25.BuiltinPluginName.EnableLibraryPlugin;
|
7417
7444
|
}
|
7418
7445
|
static setEnabled(compiler, type) {
|
7419
7446
|
getEnabledTypes2(compiler).add(type);
|
@@ -7435,32 +7462,32 @@ var EnableLibraryPlugin = class extends RspackBuiltinPlugin {
|
|
7435
7462
|
};
|
7436
7463
|
|
7437
7464
|
// src/builtin-plugin/EnableWasmLoadingPlugin.ts
|
7438
|
-
var
|
7465
|
+
var import_binding26 = require("@rspack/binding");
|
7439
7466
|
var EnableWasmLoadingPlugin = create2(
|
7440
|
-
|
7467
|
+
import_binding26.BuiltinPluginName.EnableWasmLoadingPlugin,
|
7441
7468
|
(type) => type
|
7442
7469
|
);
|
7443
7470
|
|
7444
7471
|
// src/builtin-plugin/EnsureChunkConditionsPlugin.ts
|
7445
|
-
var
|
7472
|
+
var import_binding27 = require("@rspack/binding");
|
7446
7473
|
var EnsureChunkConditionsPlugin = create2(
|
7447
|
-
|
7474
|
+
import_binding27.BuiltinPluginName.EnsureChunkConditionsPlugin,
|
7448
7475
|
() => {
|
7449
7476
|
}
|
7450
7477
|
);
|
7451
7478
|
|
7452
7479
|
// src/builtin-plugin/EvalDevToolModulePlugin.ts
|
7453
|
-
var
|
7480
|
+
var import_binding28 = require("@rspack/binding");
|
7454
7481
|
var EvalDevToolModulePlugin = create2(
|
7455
|
-
|
7482
|
+
import_binding28.BuiltinPluginName.EvalDevToolModulePlugin,
|
7456
7483
|
(options) => options,
|
7457
7484
|
"compilation"
|
7458
7485
|
);
|
7459
7486
|
|
7460
7487
|
// src/builtin-plugin/EvalSourceMapDevToolPlugin.ts
|
7461
|
-
var
|
7488
|
+
var import_binding29 = require("@rspack/binding");
|
7462
7489
|
var EvalSourceMapDevToolPlugin = create2(
|
7463
|
-
|
7490
|
+
import_binding29.BuiltinPluginName.EvalSourceMapDevToolPlugin,
|
7464
7491
|
(options) => {
|
7465
7492
|
return {
|
7466
7493
|
filename: options.filename || void 0,
|
@@ -7476,13 +7503,13 @@ var EvalSourceMapDevToolPlugin = create2(
|
|
7476
7503
|
);
|
7477
7504
|
|
7478
7505
|
// src/builtin-plugin/ExternalsPlugin.ts
|
7479
|
-
var
|
7506
|
+
var import_binding30 = require("@rspack/binding");
|
7480
7507
|
var ExternalsPlugin = class extends RspackBuiltinPlugin {
|
7481
7508
|
constructor(type, externals2) {
|
7482
7509
|
super();
|
7483
7510
|
this.type = type;
|
7484
7511
|
this.externals = externals2;
|
7485
|
-
this.name =
|
7512
|
+
this.name = import_binding30.BuiltinPluginName.ExternalsPlugin;
|
7486
7513
|
}
|
7487
7514
|
raw(compiler) {
|
7488
7515
|
const { type, externals: externals2 } = this;
|
@@ -7510,38 +7537,36 @@ function getRawExternalItem(compiler, item) {
|
|
7510
7537
|
issuer: data.contextInfo.issuer,
|
7511
7538
|
issuerLayer: data.contextInfo.issuerLayer ?? null
|
7512
7539
|
},
|
7513
|
-
getResolve:
|
7540
|
+
getResolve: (options) => (context2, request, callback) => {
|
7514
7541
|
const resolver = new Resolver(ctx.getResolver());
|
7542
|
+
const child = options ? resolver.withOptions(options) : resolver;
|
7515
7543
|
const getResolveContext = () => ({
|
7516
7544
|
fileDependencies: compiler._lastCompilation.fileDependencies,
|
7517
7545
|
missingDependencies: compiler._lastCompilation.missingDependencies,
|
7518
7546
|
contextDependencies: compiler._lastCompilation.contextDependencies
|
7519
7547
|
});
|
7520
|
-
|
7521
|
-
|
7522
|
-
|
7548
|
+
if (callback) {
|
7549
|
+
child.resolve(
|
7550
|
+
{},
|
7551
|
+
context2,
|
7552
|
+
request,
|
7553
|
+
getResolveContext(),
|
7554
|
+
callback
|
7555
|
+
);
|
7556
|
+
} else {
|
7557
|
+
return new Promise((resolve3, reject2) => {
|
7523
7558
|
child.resolve(
|
7524
7559
|
{},
|
7525
7560
|
context2,
|
7526
7561
|
request,
|
7527
7562
|
getResolveContext(),
|
7528
|
-
|
7563
|
+
(err, result2) => {
|
7564
|
+
if (err) reject2(err);
|
7565
|
+
else resolve3(result2);
|
7566
|
+
}
|
7529
7567
|
);
|
7530
|
-
}
|
7531
|
-
|
7532
|
-
child.resolve(
|
7533
|
-
{},
|
7534
|
-
context2,
|
7535
|
-
request,
|
7536
|
-
getResolveContext(),
|
7537
|
-
(err, result2) => {
|
7538
|
-
if (err) reject2(err);
|
7539
|
-
else resolve3(result2);
|
7540
|
-
}
|
7541
|
-
);
|
7542
|
-
});
|
7543
|
-
}
|
7544
|
-
};
|
7568
|
+
});
|
7569
|
+
}
|
7545
7570
|
}
|
7546
7571
|
},
|
7547
7572
|
(err, result2, type) => {
|
@@ -7591,30 +7616,30 @@ function getRawExternalItemValue(value) {
|
|
7591
7616
|
}
|
7592
7617
|
|
7593
7618
|
// src/builtin-plugin/FileUriPlugin.ts
|
7594
|
-
var
|
7619
|
+
var import_binding31 = require("@rspack/binding");
|
7595
7620
|
var FileUriPlugin = create2(
|
7596
|
-
|
7621
|
+
import_binding31.BuiltinPluginName.FileUriPlugin,
|
7597
7622
|
() => {
|
7598
7623
|
},
|
7599
7624
|
"compilation"
|
7600
7625
|
);
|
7601
7626
|
|
7602
7627
|
// src/builtin-plugin/FlagDependencyExportsPlugin.ts
|
7603
|
-
var
|
7628
|
+
var import_binding32 = require("@rspack/binding");
|
7604
7629
|
var FlagDependencyExportsPlugin = create2(
|
7605
|
-
|
7630
|
+
import_binding32.BuiltinPluginName.FlagDependencyExportsPlugin,
|
7606
7631
|
() => {
|
7607
7632
|
},
|
7608
7633
|
"compilation"
|
7609
7634
|
);
|
7610
7635
|
|
7611
7636
|
// src/builtin-plugin/FlagDependencyUsagePlugin.ts
|
7612
|
-
var
|
7637
|
+
var import_binding33 = require("@rspack/binding");
|
7613
7638
|
var FlagDependencyUsagePlugin = class extends RspackBuiltinPlugin {
|
7614
7639
|
constructor(global) {
|
7615
7640
|
super();
|
7616
7641
|
this.global = global;
|
7617
|
-
this.name =
|
7642
|
+
this.name = import_binding33.BuiltinPluginName.FlagDependencyUsagePlugin;
|
7618
7643
|
this.affectedHooks = "compilation";
|
7619
7644
|
}
|
7620
7645
|
raw(compiler) {
|
@@ -7645,11 +7670,11 @@ var FlagDependencyUsagePlugin = class extends RspackBuiltinPlugin {
|
|
7645
7670
|
};
|
7646
7671
|
|
7647
7672
|
// src/builtin-plugin/HotModuleReplacementPlugin.ts
|
7648
|
-
var
|
7673
|
+
var import_binding34 = require("@rspack/binding");
|
7649
7674
|
var HotModuleReplacementPlugin = class extends RspackBuiltinPlugin {
|
7650
7675
|
constructor() {
|
7651
7676
|
super(...arguments);
|
7652
|
-
this.name =
|
7677
|
+
this.name = import_binding34.BuiltinPluginName.HotModuleReplacementPlugin;
|
7653
7678
|
}
|
7654
7679
|
raw(compiler) {
|
7655
7680
|
if (compiler.options.output.strictModuleErrorHandling === void 0) {
|
@@ -7662,7 +7687,7 @@ var HotModuleReplacementPlugin = class extends RspackBuiltinPlugin {
|
|
7662
7687
|
// src/builtin-plugin/html-plugin/plugin.ts
|
7663
7688
|
var import_node_fs = __toESM(require("fs"));
|
7664
7689
|
var import_node_path6 = __toESM(require("path"));
|
7665
|
-
var
|
7690
|
+
var import_binding35 = require("@rspack/binding");
|
7666
7691
|
|
7667
7692
|
// src/builtin-plugin/html-plugin/hooks.ts
|
7668
7693
|
var liteTapable5 = __toESM(require("@rspack/lite-tapable"));
|
@@ -7729,11 +7754,11 @@ function isNonEmptyArray(value) {
|
|
7729
7754
|
return value.length !== 0;
|
7730
7755
|
}
|
7731
7756
|
var identifierRegex = /[$_\p{ID_Start}][$\u200c\u200d\p{ID_Continue}]*/u;
|
7732
|
-
function joinPath(
|
7733
|
-
if (
|
7734
|
-
return
|
7757
|
+
function joinPath(path12) {
|
7758
|
+
if (path12.length === 1) {
|
7759
|
+
return path12[0].toString();
|
7735
7760
|
}
|
7736
|
-
return
|
7761
|
+
return path12.reduce((acc, item) => {
|
7737
7762
|
if (typeof item === "number") {
|
7738
7763
|
return acc + "[" + item.toString() + "]";
|
7739
7764
|
}
|
@@ -8004,7 +8029,7 @@ var cleanPluginOptions = (compilation) => {
|
|
8004
8029
|
|
8005
8030
|
// src/builtin-plugin/html-plugin/plugin.ts
|
8006
8031
|
var HtmlRspackPluginImpl = create2(
|
8007
|
-
|
8032
|
+
import_binding35.BuiltinPluginName.HtmlRspackPlugin,
|
8008
8033
|
function(c = {}) {
|
8009
8034
|
validateHtmlPluginOptions(c);
|
8010
8035
|
const meta = {};
|
@@ -8211,9 +8236,9 @@ HtmlRspackPlugin.getHooks = HtmlRspackPlugin.getCompilationHooks = getPluginHook
|
|
8211
8236
|
HtmlRspackPlugin.version = 5;
|
8212
8237
|
|
8213
8238
|
// src/builtin-plugin/HttpExternalsRspackPlugin.ts
|
8214
|
-
var
|
8239
|
+
var import_binding36 = require("@rspack/binding");
|
8215
8240
|
var HttpExternalsRspackPlugin = create2(
|
8216
|
-
|
8241
|
+
import_binding36.BuiltinPluginName.HttpExternalsRspackPlugin,
|
8217
8242
|
(css, webAsync) => {
|
8218
8243
|
return {
|
8219
8244
|
css,
|
@@ -8222,8 +8247,53 @@ var HttpExternalsRspackPlugin = create2(
|
|
8222
8247
|
}
|
8223
8248
|
);
|
8224
8249
|
|
8250
|
+
// src/builtin-plugin/HttpUriPlugin.ts
|
8251
|
+
var import_node_path7 = __toESM(require("path"));
|
8252
|
+
var import_binding37 = require("@rspack/binding");
|
8253
|
+
var defaultHttpClient = (url2, headers) => {
|
8254
|
+
return fetch(url2, { headers }).then((response) => {
|
8255
|
+
return response.arrayBuffer().then((buffer) => {
|
8256
|
+
const responseHeaders = {};
|
8257
|
+
response.headers.forEach((value, key) => {
|
8258
|
+
responseHeaders[key] = value;
|
8259
|
+
});
|
8260
|
+
return {
|
8261
|
+
status: response.status,
|
8262
|
+
headers: responseHeaders,
|
8263
|
+
body: Buffer.from(buffer)
|
8264
|
+
};
|
8265
|
+
});
|
8266
|
+
});
|
8267
|
+
};
|
8268
|
+
var HttpUriPlugin = class extends RspackBuiltinPlugin {
|
8269
|
+
constructor(options) {
|
8270
|
+
super();
|
8271
|
+
this.options = options;
|
8272
|
+
this.name = import_binding37.BuiltinPluginName.HttpUriPlugin;
|
8273
|
+
this.affectedHooks = "compilation";
|
8274
|
+
}
|
8275
|
+
raw(compiler) {
|
8276
|
+
const { options } = this;
|
8277
|
+
const lockfileLocation = options.lockfileLocation ?? import_node_path7.default.join(
|
8278
|
+
compiler.context,
|
8279
|
+
compiler.name ? `${compiler.name}.rspack.lock` : "rspack.lock"
|
8280
|
+
);
|
8281
|
+
const cacheLocation = options.cacheLocation === false ? void 0 : options.cacheLocation ?? `${lockfileLocation}.data`;
|
8282
|
+
const raw = {
|
8283
|
+
allowedUris: options.allowedUris,
|
8284
|
+
lockfileLocation,
|
8285
|
+
cacheLocation,
|
8286
|
+
upgrade: options.upgrade ?? false,
|
8287
|
+
// frozen: options.frozen,
|
8288
|
+
// proxy: options.proxy,
|
8289
|
+
httpClient: options.httpClient ?? defaultHttpClient
|
8290
|
+
};
|
8291
|
+
return createBuiltinPlugin(this.name, raw);
|
8292
|
+
}
|
8293
|
+
};
|
8294
|
+
|
8225
8295
|
// src/builtin-plugin/IgnorePlugin.ts
|
8226
|
-
var
|
8296
|
+
var import_binding38 = require("@rspack/binding");
|
8227
8297
|
var import_zod2 = require("../compiled/zod/index.js");
|
8228
8298
|
var IgnorePluginOptions = import_zod2.z.union([
|
8229
8299
|
import_zod2.z.object({
|
@@ -8235,7 +8305,7 @@ var IgnorePluginOptions = import_zod2.z.union([
|
|
8235
8305
|
})
|
8236
8306
|
]);
|
8237
8307
|
var IgnorePlugin = create2(
|
8238
|
-
|
8308
|
+
import_binding38.BuiltinPluginName.IgnorePlugin,
|
8239
8309
|
(options) => {
|
8240
8310
|
validate(options, IgnorePluginOptions);
|
8241
8311
|
return options;
|
@@ -8243,22 +8313,22 @@ var IgnorePlugin = create2(
|
|
8243
8313
|
);
|
8244
8314
|
|
8245
8315
|
// src/builtin-plugin/InferAsyncModulesPlugin.ts
|
8246
|
-
var
|
8316
|
+
var import_binding39 = require("@rspack/binding");
|
8247
8317
|
var InferAsyncModulesPlugin = create2(
|
8248
|
-
|
8318
|
+
import_binding39.BuiltinPluginName.InferAsyncModulesPlugin,
|
8249
8319
|
() => {
|
8250
8320
|
},
|
8251
8321
|
"compilation"
|
8252
8322
|
);
|
8253
8323
|
|
8254
8324
|
// src/builtin-plugin/JavascriptModulesPlugin.ts
|
8255
|
-
var
|
8325
|
+
var import_binding40 = require("@rspack/binding");
|
8256
8326
|
var liteTapable6 = __toESM(require("@rspack/lite-tapable"));
|
8257
8327
|
var compilationHooksMap3 = /* @__PURE__ */ new WeakMap();
|
8258
8328
|
var JavascriptModulesPlugin = class extends RspackBuiltinPlugin {
|
8259
8329
|
constructor() {
|
8260
8330
|
super(...arguments);
|
8261
|
-
this.name =
|
8331
|
+
this.name = import_binding40.BuiltinPluginName.JavascriptModulesPlugin;
|
8262
8332
|
this.affectedHooks = "compilation";
|
8263
8333
|
}
|
8264
8334
|
raw() {
|
@@ -8282,233 +8352,126 @@ var JavascriptModulesPlugin = class extends RspackBuiltinPlugin {
|
|
8282
8352
|
};
|
8283
8353
|
|
8284
8354
|
// src/builtin-plugin/JsLoaderRspackPlugin.ts
|
8285
|
-
var
|
8355
|
+
var import_binding41 = require("@rspack/binding");
|
8286
8356
|
var JsLoaderRspackPlugin = create2(
|
8287
|
-
|
8357
|
+
import_binding41.BuiltinPluginName.JsLoaderRspackPlugin,
|
8288
8358
|
(compiler) => runLoaders.bind(null, compiler),
|
8289
8359
|
/* Not Inheretable */
|
8290
8360
|
"thisCompilation"
|
8291
8361
|
);
|
8292
8362
|
|
8293
8363
|
// src/builtin-plugin/JsonModulesPlugin.ts
|
8294
|
-
var
|
8364
|
+
var import_binding42 = require("@rspack/binding");
|
8295
8365
|
var JsonModulesPlugin = create2(
|
8296
|
-
|
8366
|
+
import_binding42.BuiltinPluginName.JsonModulesPlugin,
|
8297
8367
|
() => {
|
8298
8368
|
},
|
8299
8369
|
"compilation"
|
8300
8370
|
);
|
8301
8371
|
|
8302
|
-
// src/builtin-plugin/lazy-compilation/backend.ts
|
8303
|
-
var getBackend = (options) => {
|
8304
|
-
const state = {
|
8305
|
-
module: unimplemented,
|
8306
|
-
dispose: unimplemented
|
8307
|
-
};
|
8308
|
-
return {
|
8309
|
-
state,
|
8310
|
-
backend: (compiler, callback) => {
|
8311
|
-
const logger = compiler.getInfrastructureLogger("LazyCompilationBackend");
|
8312
|
-
const activeModules = /* @__PURE__ */ new Map();
|
8313
|
-
const filesByKey = /* @__PURE__ */ new Map();
|
8314
|
-
const prefix = "/lazy-compilation-using-";
|
8315
|
-
const isHttps = options.protocol === "https" || typeof options.server === "object" && ("key" in options.server || "pfx" in options.server);
|
8316
|
-
const createServer = typeof options.server === "function" ? options.server : (() => {
|
8317
|
-
const http = isHttps ? require("https") : require("http");
|
8318
|
-
return http.createServer.bind(http, options.server);
|
8319
|
-
})();
|
8320
|
-
const listen = typeof options.listen === "function" ? options.listen : typeof options.server === "function" && !options.listen ? (
|
8321
|
-
// if user offers custom server, no need to listen
|
8322
|
-
() => {
|
8323
|
-
}
|
8324
|
-
) : (server2) => {
|
8325
|
-
let { listen: listen2 } = options;
|
8326
|
-
if (typeof listen2 === "object" && !("port" in listen2))
|
8327
|
-
listen2 = { ...listen2, port: void 0 };
|
8328
|
-
server2.listen(listen2);
|
8329
|
-
};
|
8330
|
-
const protocol = options.protocol || (isHttps ? "https" : "http");
|
8331
|
-
const requestListener = (req, res) => {
|
8332
|
-
var _a;
|
8333
|
-
if (!((_a = req.url) == null ? void 0 : _a.startsWith(prefix))) {
|
8334
|
-
return;
|
8335
|
-
}
|
8336
|
-
const keys = req.url.slice(prefix.length).split("@");
|
8337
|
-
req.socket.on("close", () => {
|
8338
|
-
setTimeout(() => {
|
8339
|
-
for (const key of keys) {
|
8340
|
-
const oldValue = activeModules.get(key) || 0;
|
8341
|
-
activeModules.set(key, oldValue - 1);
|
8342
|
-
if (oldValue === 1) {
|
8343
|
-
logger.log(
|
8344
|
-
`${key} is no longer in use. Next compilation will skip this module.`
|
8345
|
-
);
|
8346
|
-
}
|
8347
|
-
}
|
8348
|
-
}, 12e4);
|
8349
|
-
});
|
8350
|
-
req.socket.setNoDelay(true);
|
8351
|
-
res.writeHead(200, {
|
8352
|
-
"content-type": "text/event-stream",
|
8353
|
-
"Access-Control-Allow-Origin": "*",
|
8354
|
-
"Access-Control-Allow-Methods": "*",
|
8355
|
-
"Access-Control-Allow-Headers": "*"
|
8356
|
-
});
|
8357
|
-
res.write("\n");
|
8358
|
-
const moduleActivated = [];
|
8359
|
-
for (const key of keys) {
|
8360
|
-
const oldValue = activeModules.get(key) || 0;
|
8361
|
-
activeModules.set(key, oldValue + 1);
|
8362
|
-
if (oldValue === 0) {
|
8363
|
-
logger.log(`${key} is now in use and will be compiled.`);
|
8364
|
-
moduleActivated.push(key);
|
8365
|
-
}
|
8366
|
-
}
|
8367
|
-
if (moduleActivated.length && compiler.watching) {
|
8368
|
-
compiler.watching.lazyCompilationInvalidate(
|
8369
|
-
new Set(moduleActivated.map((key) => filesByKey.get(key)))
|
8370
|
-
);
|
8371
|
-
}
|
8372
|
-
};
|
8373
|
-
const server = createServer();
|
8374
|
-
server.on("request", requestListener);
|
8375
|
-
let isClosing = false;
|
8376
|
-
const sockets = /* @__PURE__ */ new Set();
|
8377
|
-
server.on("connection", (socket) => {
|
8378
|
-
sockets.add(socket);
|
8379
|
-
socket.on("close", () => {
|
8380
|
-
sockets.delete(socket);
|
8381
|
-
});
|
8382
|
-
if (isClosing) socket.destroy();
|
8383
|
-
});
|
8384
|
-
server.on("listening", (err) => {
|
8385
|
-
if (err) return callback(err);
|
8386
|
-
const addr = server.address();
|
8387
|
-
if (typeof addr === "string")
|
8388
|
-
throw new Error("addr must not be a string");
|
8389
|
-
const urlBase = addr.address === "::" || addr.address === "0.0.0.0" ? `${protocol}://localhost:${addr.port}` : addr.family === "IPv6" ? `${protocol}://[${addr.address}]:${addr.port}` : `${protocol}://${addr.address}:${addr.port}`;
|
8390
|
-
logger.log(
|
8391
|
-
`Server-Sent-Events server for lazy compilation open at ${urlBase}.`
|
8392
|
-
);
|
8393
|
-
const result2 = {
|
8394
|
-
dispose(callback2) {
|
8395
|
-
isClosing = true;
|
8396
|
-
server.off("request", requestListener);
|
8397
|
-
server.close((err2) => {
|
8398
|
-
callback2(err2);
|
8399
|
-
});
|
8400
|
-
for (const socket of sockets) {
|
8401
|
-
socket.destroy(new Error("Server is disposing"));
|
8402
|
-
}
|
8403
|
-
},
|
8404
|
-
module({
|
8405
|
-
module: originalModule,
|
8406
|
-
path: path11
|
8407
|
-
}) {
|
8408
|
-
const key = `${encodeURIComponent(
|
8409
|
-
originalModule.replace(/\\/g, "/").replace(/@/g, "_")
|
8410
|
-
).replace(/%(2F|3A|24|26|2B|2C|3B|3D|3A)/g, decodeURIComponent)}`;
|
8411
|
-
filesByKey.set(key, path11);
|
8412
|
-
const active = activeModules.get(key) > 0;
|
8413
|
-
return {
|
8414
|
-
client: `${options.client}?${encodeURIComponent(urlBase + prefix)}`,
|
8415
|
-
data: key,
|
8416
|
-
active
|
8417
|
-
};
|
8418
|
-
}
|
8419
|
-
};
|
8420
|
-
state.module = result2.module;
|
8421
|
-
state.dispose = result2.dispose;
|
8422
|
-
callback(null, result2);
|
8423
|
-
});
|
8424
|
-
listen(server);
|
8425
|
-
}
|
8426
|
-
};
|
8427
|
-
};
|
8428
|
-
var backend_default = getBackend;
|
8429
|
-
function unimplemented() {
|
8430
|
-
throw new Error("access before initialization");
|
8431
|
-
}
|
8432
|
-
|
8433
8372
|
// src/builtin-plugin/lazy-compilation/lazyCompilation.ts
|
8434
|
-
var
|
8373
|
+
var import_binding43 = require("@rspack/binding");
|
8435
8374
|
var BuiltinLazyCompilationPlugin = create2(
|
8436
|
-
|
8375
|
+
import_binding43.BuiltinPluginName.LazyCompilationPlugin,
|
8437
8376
|
(module2, cacheable, entries, imports, test) => ({ module: module2, cacheable, imports, entries, test }),
|
8438
8377
|
"thisCompilation"
|
8439
8378
|
);
|
8440
8379
|
|
8441
|
-
// src/builtin-plugin/lazy-compilation/
|
8442
|
-
var
|
8443
|
-
|
8444
|
-
|
8445
|
-
|
8446
|
-
|
8447
|
-
|
8448
|
-
|
8449
|
-
|
8450
|
-
|
8451
|
-
|
8452
|
-
|
8453
|
-
|
8454
|
-
|
8455
|
-
|
8456
|
-
|
8457
|
-
|
8458
|
-
|
8459
|
-
|
8460
|
-
|
8461
|
-
|
8462
|
-
|
8463
|
-
|
8464
|
-
|
8465
|
-
|
8466
|
-
|
8467
|
-
|
8468
|
-
|
8469
|
-
|
8470
|
-
|
8471
|
-
|
8472
|
-
|
8473
|
-
|
8474
|
-
|
8475
|
-
(
|
8476
|
-
|
8477
|
-
|
8478
|
-
|
8479
|
-
|
8480
|
-
|
8481
|
-
|
8482
|
-
|
8483
|
-
|
8484
|
-
|
8485
|
-
|
8486
|
-
|
8487
|
-
|
8380
|
+
// src/builtin-plugin/lazy-compilation/middleware.ts
|
8381
|
+
var LAZY_COMPILATION_PREFIX = "/lazy-compilation-using-";
|
8382
|
+
var getDefaultClient = (compiler) => require.resolve(`../hot/lazy-compilation-${compiler.options.externalsPresets.node ? "node" : "web"}.js`);
|
8383
|
+
var noop2 = (_req, _res, next) => {
|
8384
|
+
if (typeof next === "function") {
|
8385
|
+
next();
|
8386
|
+
}
|
8387
|
+
};
|
8388
|
+
var lazyCompilationMiddleware = (compiler, userOptions = {}) => {
|
8389
|
+
if (userOptions === false) {
|
8390
|
+
return noop2;
|
8391
|
+
}
|
8392
|
+
const options = userOptions === true ? {} : userOptions;
|
8393
|
+
const activeModules = /* @__PURE__ */ new Map();
|
8394
|
+
const filesByKey = /* @__PURE__ */ new Map();
|
8395
|
+
new BuiltinLazyCompilationPlugin(
|
8396
|
+
({ module: module2, path: path12 }) => {
|
8397
|
+
const key = encodeURIComponent(
|
8398
|
+
module2.replace(/\\/g, "/").replace(/@/g, "_")
|
8399
|
+
).replace(/%(2F|3A|24|26|2B|2C|3B|3D)/g, decodeURIComponent);
|
8400
|
+
filesByKey.set(key, path12);
|
8401
|
+
const active = activeModules.get(key) === true;
|
8402
|
+
return {
|
8403
|
+
client: `${options.client || getDefaultClient(compiler)}?${encodeURIComponent((options.serverUrl ?? "") + LAZY_COMPILATION_PREFIX)}`,
|
8404
|
+
data: key,
|
8405
|
+
active
|
8406
|
+
};
|
8407
|
+
},
|
8408
|
+
// @ts-expect-error internal option
|
8409
|
+
options.cacheable ?? true,
|
8410
|
+
options.entries ?? true,
|
8411
|
+
options.imports ?? true,
|
8412
|
+
typeof options.test === "function" ? (module2) => {
|
8413
|
+
const test = options.test;
|
8414
|
+
return test(module2);
|
8415
|
+
} : options.test
|
8416
|
+
).apply(compiler);
|
8417
|
+
return lazyCompilationMiddlewareInternal(compiler, activeModules, filesByKey);
|
8418
|
+
};
|
8419
|
+
var lazyCompilationMiddlewareInternal = (compiler, activeModules, filesByKey) => {
|
8420
|
+
const logger = compiler.getInfrastructureLogger("LazyCompilation");
|
8421
|
+
return (req, res, next) => {
|
8422
|
+
var _a;
|
8423
|
+
if (!((_a = req.url) == null ? void 0 : _a.startsWith(LAZY_COMPILATION_PREFIX))) {
|
8424
|
+
return next == null ? void 0 : next();
|
8425
|
+
}
|
8426
|
+
const keys = req.url.slice(LAZY_COMPILATION_PREFIX.length).split("@");
|
8427
|
+
req.socket.setNoDelay(true);
|
8428
|
+
res.setHeader("content-type", "text/event-stream");
|
8429
|
+
res.writeHead(200);
|
8430
|
+
res.write("\n");
|
8431
|
+
const moduleActivated = [];
|
8432
|
+
for (const key of keys) {
|
8433
|
+
const oldValue = activeModules.get(key) ?? false;
|
8434
|
+
activeModules.set(key, true);
|
8435
|
+
if (!oldValue) {
|
8436
|
+
logger.log(`${key} is now in use and will be compiled.`);
|
8437
|
+
moduleActivated.push(key);
|
8438
|
+
}
|
8439
|
+
}
|
8440
|
+
if (moduleActivated.length && compiler.watching) {
|
8441
|
+
const rebuiltModules = new Set(
|
8442
|
+
moduleActivated.map((key) => {
|
8443
|
+
const filePath = filesByKey.get(key);
|
8444
|
+
if (!filePath) {
|
8445
|
+
logger.warn(`Cannot find correct file path for module ${key}`);
|
8446
|
+
}
|
8447
|
+
return filePath;
|
8448
|
+
}).filter(Boolean)
|
8449
|
+
);
|
8450
|
+
if (rebuiltModules.size) {
|
8451
|
+
compiler.watching.invalidateWithChangesAndRemovals(
|
8452
|
+
new Set(rebuiltModules)
|
8453
|
+
);
|
8488
8454
|
}
|
8489
|
-
|
8490
|
-
|
8491
|
-
state.dispose(callback);
|
8492
|
-
});
|
8493
|
-
}
|
8455
|
+
}
|
8456
|
+
};
|
8494
8457
|
};
|
8495
8458
|
|
8496
8459
|
// src/builtin-plugin/LimitChunkCountPlugin.ts
|
8497
|
-
var
|
8460
|
+
var import_binding44 = require("@rspack/binding");
|
8498
8461
|
var LimitChunkCountPlugin = create2(
|
8499
|
-
|
8462
|
+
import_binding44.BuiltinPluginName.LimitChunkCountPlugin,
|
8500
8463
|
(options) => {
|
8501
8464
|
return options;
|
8502
8465
|
}
|
8503
8466
|
);
|
8504
8467
|
|
8505
8468
|
// src/builtin-plugin/MangleExportsPlugin.ts
|
8506
|
-
var
|
8469
|
+
var import_binding45 = require("@rspack/binding");
|
8507
8470
|
var MangleExportsPlugin = class extends RspackBuiltinPlugin {
|
8508
8471
|
constructor(deterministic) {
|
8509
8472
|
super();
|
8510
8473
|
this.deterministic = deterministic;
|
8511
|
-
this.name =
|
8474
|
+
this.name = import_binding45.BuiltinPluginName.MangleExportsPlugin;
|
8512
8475
|
this.affectedHooks = "compilation";
|
8513
8476
|
}
|
8514
8477
|
raw(compiler) {
|
@@ -8539,27 +8502,27 @@ var MangleExportsPlugin = class extends RspackBuiltinPlugin {
|
|
8539
8502
|
};
|
8540
8503
|
|
8541
8504
|
// src/builtin-plugin/MergeDuplicateChunksPlugin.ts
|
8542
|
-
var
|
8505
|
+
var import_binding46 = require("@rspack/binding");
|
8543
8506
|
var MergeDuplicateChunksPlugin = create2(
|
8544
|
-
|
8507
|
+
import_binding46.BuiltinPluginName.MergeDuplicateChunksPlugin,
|
8545
8508
|
() => {
|
8546
8509
|
}
|
8547
8510
|
);
|
8548
8511
|
|
8549
8512
|
// src/builtin-plugin/ModuleChunkFormatPlugin.ts
|
8550
|
-
var
|
8513
|
+
var import_binding47 = require("@rspack/binding");
|
8551
8514
|
var ModuleChunkFormatPlugin = create2(
|
8552
|
-
|
8515
|
+
import_binding47.BuiltinPluginName.ModuleChunkFormatPlugin,
|
8553
8516
|
() => {
|
8554
8517
|
}
|
8555
8518
|
);
|
8556
8519
|
|
8557
8520
|
// src/builtin-plugin/ModuleConcatenationPlugin.ts
|
8558
|
-
var
|
8521
|
+
var import_binding48 = require("@rspack/binding");
|
8559
8522
|
var ModuleConcatenationPlugin = class extends RspackBuiltinPlugin {
|
8560
8523
|
constructor() {
|
8561
8524
|
super(...arguments);
|
8562
|
-
this.name =
|
8525
|
+
this.name = import_binding48.BuiltinPluginName.ModuleConcatenationPlugin;
|
8563
8526
|
this.affectedHooks = "compilation";
|
8564
8527
|
}
|
8565
8528
|
raw(compiler) {
|
@@ -8614,29 +8577,29 @@ var ModuleConcatenationPlugin = class extends RspackBuiltinPlugin {
|
|
8614
8577
|
};
|
8615
8578
|
|
8616
8579
|
// src/builtin-plugin/NamedChunkIdsPlugin.ts
|
8617
|
-
var
|
8580
|
+
var import_binding49 = require("@rspack/binding");
|
8618
8581
|
var NamedChunkIdsPlugin = create2(
|
8619
|
-
|
8582
|
+
import_binding49.BuiltinPluginName.NamedChunkIdsPlugin,
|
8620
8583
|
() => {
|
8621
8584
|
},
|
8622
8585
|
"compilation"
|
8623
8586
|
);
|
8624
8587
|
|
8625
8588
|
// src/builtin-plugin/NamedModuleIdsPlugin.ts
|
8626
|
-
var
|
8589
|
+
var import_binding50 = require("@rspack/binding");
|
8627
8590
|
var NamedModuleIdsPlugin = create2(
|
8628
|
-
|
8591
|
+
import_binding50.BuiltinPluginName.NamedModuleIdsPlugin,
|
8629
8592
|
() => {
|
8630
8593
|
},
|
8631
8594
|
"compilation"
|
8632
8595
|
);
|
8633
8596
|
|
8634
8597
|
// src/builtin-plugin/NaturalChunkIdsPlugin.ts
|
8635
|
-
var
|
8598
|
+
var import_binding51 = require("@rspack/binding");
|
8636
8599
|
var NaturalChunkIdsPlugin = class extends RspackBuiltinPlugin {
|
8637
8600
|
constructor() {
|
8638
8601
|
super(...arguments);
|
8639
|
-
this.name =
|
8602
|
+
this.name = import_binding51.BuiltinPluginName.NaturalChunkIdsPlugin;
|
8640
8603
|
this.affectedHooks = "compilation";
|
8641
8604
|
}
|
8642
8605
|
raw(compiler) {
|
@@ -8655,11 +8618,11 @@ var NaturalChunkIdsPlugin = class extends RspackBuiltinPlugin {
|
|
8655
8618
|
};
|
8656
8619
|
|
8657
8620
|
// src/builtin-plugin/NaturalModuleIdsPlugin.ts
|
8658
|
-
var
|
8621
|
+
var import_binding52 = require("@rspack/binding");
|
8659
8622
|
var NaturalModuleIdsPlugin = class extends RspackBuiltinPlugin {
|
8660
8623
|
constructor() {
|
8661
8624
|
super(...arguments);
|
8662
|
-
this.name =
|
8625
|
+
this.name = import_binding52.BuiltinPluginName.NaturalModuleIdsPlugin;
|
8663
8626
|
this.affectedHooks = "compilation";
|
8664
8627
|
}
|
8665
8628
|
raw(compiler) {
|
@@ -8678,24 +8641,24 @@ var NaturalModuleIdsPlugin = class extends RspackBuiltinPlugin {
|
|
8678
8641
|
};
|
8679
8642
|
|
8680
8643
|
// src/builtin-plugin/NodeTargetPlugin.ts
|
8681
|
-
var
|
8644
|
+
var import_binding53 = require("@rspack/binding");
|
8682
8645
|
var NodeTargetPlugin = create2(
|
8683
|
-
|
8646
|
+
import_binding53.BuiltinPluginName.NodeTargetPlugin,
|
8684
8647
|
() => void 0
|
8685
8648
|
);
|
8686
8649
|
|
8687
8650
|
// src/builtin-plugin/OccurrenceChunkIdsPlugin.ts
|
8688
|
-
var
|
8651
|
+
var import_binding54 = require("@rspack/binding");
|
8689
8652
|
var OccurrenceChunkIdsPlugin = create2(
|
8690
|
-
|
8653
|
+
import_binding54.BuiltinPluginName.OccurrenceChunkIdsPlugin,
|
8691
8654
|
(options) => ({ ...options }),
|
8692
8655
|
"compilation"
|
8693
8656
|
);
|
8694
8657
|
|
8695
8658
|
// src/builtin-plugin/ProgressPlugin.ts
|
8696
|
-
var
|
8659
|
+
var import_binding55 = require("@rspack/binding");
|
8697
8660
|
var ProgressPlugin = create2(
|
8698
|
-
|
8661
|
+
import_binding55.BuiltinPluginName.ProgressPlugin,
|
8699
8662
|
(progress = {}) => {
|
8700
8663
|
if (typeof progress === "function") {
|
8701
8664
|
return {
|
@@ -8709,9 +8672,9 @@ var ProgressPlugin = create2(
|
|
8709
8672
|
);
|
8710
8673
|
|
8711
8674
|
// src/builtin-plugin/ProvidePlugin.ts
|
8712
|
-
var
|
8675
|
+
var import_binding56 = require("@rspack/binding");
|
8713
8676
|
var ProvidePlugin = create2(
|
8714
|
-
|
8677
|
+
import_binding56.BuiltinPluginName.ProvidePlugin,
|
8715
8678
|
(provide) => {
|
8716
8679
|
const entries = Object.entries(provide).map(([key, value]) => {
|
8717
8680
|
if (typeof value === "string") {
|
@@ -8725,27 +8688,27 @@ var ProvidePlugin = create2(
|
|
8725
8688
|
);
|
8726
8689
|
|
8727
8690
|
// src/builtin-plugin/RealContentHashPlugin.ts
|
8728
|
-
var
|
8691
|
+
var import_binding57 = require("@rspack/binding");
|
8729
8692
|
var RealContentHashPlugin = create2(
|
8730
|
-
|
8693
|
+
import_binding57.BuiltinPluginName.RealContentHashPlugin,
|
8731
8694
|
() => {
|
8732
8695
|
},
|
8733
8696
|
"compilation"
|
8734
8697
|
);
|
8735
8698
|
|
8736
8699
|
// src/builtin-plugin/RemoveEmptyChunksPlugin.ts
|
8737
|
-
var
|
8700
|
+
var import_binding58 = require("@rspack/binding");
|
8738
8701
|
var RemoveEmptyChunksPlugin = create2(
|
8739
|
-
|
8702
|
+
import_binding58.BuiltinPluginName.RemoveEmptyChunksPlugin,
|
8740
8703
|
() => {
|
8741
8704
|
},
|
8742
8705
|
"compilation"
|
8743
8706
|
);
|
8744
8707
|
|
8745
8708
|
// src/builtin-plugin/RuntimeChunkPlugin.ts
|
8746
|
-
var
|
8709
|
+
var import_binding59 = require("@rspack/binding");
|
8747
8710
|
var RuntimeChunkPlugin = create2(
|
8748
|
-
|
8711
|
+
import_binding59.BuiltinPluginName.RuntimeChunkPlugin,
|
8749
8712
|
(options) => options,
|
8750
8713
|
"thisCompilation"
|
8751
8714
|
);
|
@@ -8823,18 +8786,18 @@ var createRuntimePluginHooksRegisters = (getCompiler, createTap, createMapTap) =
|
|
8823
8786
|
};
|
8824
8787
|
|
8825
8788
|
// src/builtin-plugin/SideEffectsFlagPlugin.ts
|
8826
|
-
var
|
8789
|
+
var import_binding60 = require("@rspack/binding");
|
8827
8790
|
var SideEffectsFlagPlugin = create2(
|
8828
|
-
|
8791
|
+
import_binding60.BuiltinPluginName.SideEffectsFlagPlugin,
|
8829
8792
|
() => {
|
8830
8793
|
},
|
8831
8794
|
"compilation"
|
8832
8795
|
);
|
8833
8796
|
|
8834
8797
|
// src/builtin-plugin/SizeLimitsPlugin.ts
|
8835
|
-
var
|
8798
|
+
var import_binding61 = require("@rspack/binding");
|
8836
8799
|
var SizeLimitsPlugin = create2(
|
8837
|
-
|
8800
|
+
import_binding61.BuiltinPluginName.SizeLimitsPlugin,
|
8838
8801
|
(options) => {
|
8839
8802
|
const hints = options.hints === false ? void 0 : options.hints;
|
8840
8803
|
return { ...options, hints };
|
@@ -8842,16 +8805,16 @@ var SizeLimitsPlugin = create2(
|
|
8842
8805
|
);
|
8843
8806
|
|
8844
8807
|
// src/builtin-plugin/SourceMapDevToolPlugin.ts
|
8845
|
-
var
|
8808
|
+
var import_binding62 = require("@rspack/binding");
|
8846
8809
|
var SourceMapDevToolPlugin = create2(
|
8847
|
-
|
8810
|
+
import_binding62.BuiltinPluginName.SourceMapDevToolPlugin,
|
8848
8811
|
(options) => options,
|
8849
8812
|
"compilation"
|
8850
8813
|
);
|
8851
8814
|
|
8852
8815
|
// src/builtin-plugin/SplitChunksPlugin.ts
|
8853
8816
|
var import_node_assert5 = __toESM(require("assert"));
|
8854
|
-
var
|
8817
|
+
var import_binding63 = require("@rspack/binding");
|
8855
8818
|
|
8856
8819
|
// src/util/SplitChunkSize.ts
|
8857
8820
|
var JsSplitChunkSizes = class {
|
@@ -8874,7 +8837,7 @@ var SplitChunksPlugin = class extends RspackBuiltinPlugin {
|
|
8874
8837
|
constructor(options) {
|
8875
8838
|
super();
|
8876
8839
|
this.options = options;
|
8877
|
-
this.name =
|
8840
|
+
this.name = import_binding63.BuiltinPluginName.SplitChunksPlugin;
|
8878
8841
|
this.affectedHooks = "thisCompilation";
|
8879
8842
|
}
|
8880
8843
|
raw(compiler) {
|
@@ -8974,9 +8937,9 @@ function toRawSplitChunksOptions(sc, compiler) {
|
|
8974
8937
|
}
|
8975
8938
|
|
8976
8939
|
// src/builtin-plugin/LightningCssMinimizerRspackPlugin.ts
|
8977
|
-
var
|
8940
|
+
var import_binding64 = require("@rspack/binding");
|
8978
8941
|
var LightningCssMinimizerRspackPlugin = create2(
|
8979
|
-
|
8942
|
+
import_binding64.BuiltinPluginName.LightningCssMinimizerRspackPlugin,
|
8980
8943
|
(options) => {
|
8981
8944
|
var _a, _b, _c;
|
8982
8945
|
const { include, exclude, draft, nonStandard, pseudoClasses, drafts } = (options == null ? void 0 : options.minimizerOptions) ?? {};
|
@@ -9004,16 +8967,16 @@ var LightningCssMinimizerRspackPlugin = create2(
|
|
9004
8967
|
);
|
9005
8968
|
|
9006
8969
|
// src/builtin-plugin/RemoveDuplicateModulesPlugin.ts
|
9007
|
-
var
|
8970
|
+
var import_binding65 = require("@rspack/binding");
|
9008
8971
|
var RemoveDuplicateModulesPlugin = create2(
|
9009
|
-
|
8972
|
+
import_binding65.BuiltinPluginName.RemoveDuplicateModulesPlugin,
|
9010
8973
|
() => {
|
9011
8974
|
return {};
|
9012
8975
|
}
|
9013
8976
|
);
|
9014
8977
|
|
9015
8978
|
// src/builtin-plugin/SwcJsMinimizerPlugin.ts
|
9016
|
-
var
|
8979
|
+
var import_binding66 = require("@rspack/binding");
|
9017
8980
|
function isObject2(value) {
|
9018
8981
|
const type = typeof value;
|
9019
8982
|
return value != null && (type === "object" || type === "function");
|
@@ -9056,7 +9019,7 @@ function getRawExtractCommentsOptions(extractComments) {
|
|
9056
9019
|
return void 0;
|
9057
9020
|
}
|
9058
9021
|
var SwcJsMinimizerRspackPlugin = create2(
|
9059
|
-
|
9022
|
+
import_binding66.BuiltinPluginName.SwcJsMinimizerRspackPlugin,
|
9060
9023
|
(options) => {
|
9061
9024
|
var _a, _b, _c, _d, _e;
|
9062
9025
|
let compress = ((_a = options == null ? void 0 : options.minimizerOptions) == null ? void 0 : _a.compress) ?? true;
|
@@ -9094,20 +9057,20 @@ var SwcJsMinimizerRspackPlugin = create2(
|
|
9094
9057
|
);
|
9095
9058
|
|
9096
9059
|
// src/builtin-plugin/WarnCaseSensitiveModulesPlugin.ts
|
9097
|
-
var
|
9060
|
+
var import_binding67 = require("@rspack/binding");
|
9098
9061
|
var WarnCaseSensitiveModulesPlugin = create2(
|
9099
|
-
|
9062
|
+
import_binding67.BuiltinPluginName.WarnCaseSensitiveModulesPlugin,
|
9100
9063
|
() => {
|
9101
9064
|
},
|
9102
9065
|
"compilation"
|
9103
9066
|
);
|
9104
9067
|
|
9105
9068
|
// src/builtin-plugin/WebWorkerTemplatePlugin.ts
|
9106
|
-
var
|
9069
|
+
var import_binding68 = require("@rspack/binding");
|
9107
9070
|
var WebWorkerTemplatePlugin = class extends RspackBuiltinPlugin {
|
9108
9071
|
constructor() {
|
9109
9072
|
super(...arguments);
|
9110
|
-
this.name =
|
9073
|
+
this.name = import_binding68.BuiltinPluginName.WebWorkerTemplatePlugin;
|
9111
9074
|
}
|
9112
9075
|
raw(compiler) {
|
9113
9076
|
compiler.options.output.chunkLoading = "import-scripts";
|
@@ -9116,7 +9079,7 @@ var WebWorkerTemplatePlugin = class extends RspackBuiltinPlugin {
|
|
9116
9079
|
};
|
9117
9080
|
|
9118
9081
|
// src/builtin-plugin/WorkerPlugin.ts
|
9119
|
-
var
|
9082
|
+
var import_binding69 = require("@rspack/binding");
|
9120
9083
|
var WorkerPlugin = class extends RspackBuiltinPlugin {
|
9121
9084
|
constructor(chunkLoading2, wasmLoading2, module2, workerPublicPath2) {
|
9122
9085
|
super();
|
@@ -9124,7 +9087,7 @@ var WorkerPlugin = class extends RspackBuiltinPlugin {
|
|
9124
9087
|
this.wasmLoading = wasmLoading2;
|
9125
9088
|
this.module = module2;
|
9126
9089
|
this.workerPublicPath = workerPublicPath2;
|
9127
|
-
this.name =
|
9090
|
+
this.name = import_binding69.BuiltinPluginName.WorkerPlugin;
|
9128
9091
|
}
|
9129
9092
|
raw(compiler) {
|
9130
9093
|
if (this.chunkLoading) {
|
@@ -9138,25 +9101,25 @@ var WorkerPlugin = class extends RspackBuiltinPlugin {
|
|
9138
9101
|
};
|
9139
9102
|
|
9140
9103
|
// src/builtin-plugin/FetchCompileAsyncWasmPlugin.ts
|
9141
|
-
var
|
9104
|
+
var import_binding70 = require("@rspack/binding");
|
9142
9105
|
var FetchCompileAsyncWasmPlugin = create2(
|
9143
|
-
|
9106
|
+
import_binding70.BuiltinPluginName.FetchCompileAsyncWasmPlugin,
|
9144
9107
|
() => {
|
9145
9108
|
},
|
9146
9109
|
"thisCompilation"
|
9147
9110
|
);
|
9148
9111
|
|
9149
9112
|
// src/builtin-plugin/NoEmitOnErrorsPlugin.ts
|
9150
|
-
var
|
9113
|
+
var import_binding71 = require("@rspack/binding");
|
9151
9114
|
var NoEmitOnErrorsPlugin = create2(
|
9152
|
-
|
9115
|
+
import_binding71.BuiltinPluginName.NoEmitOnErrorsPlugin,
|
9153
9116
|
() => void 0
|
9154
9117
|
);
|
9155
9118
|
|
9156
9119
|
// src/builtin-plugin/ContextReplacementPlugin.ts
|
9157
|
-
var
|
9120
|
+
var import_binding72 = require("@rspack/binding");
|
9158
9121
|
var ContextReplacementPlugin = create2(
|
9159
|
-
|
9122
|
+
import_binding72.BuiltinPluginName.ContextReplacementPlugin,
|
9160
9123
|
(resourceRegExp, newContentResource, newContentRecursive, newContentRegExp) => {
|
9161
9124
|
const rawOptions = {
|
9162
9125
|
resourceRegExp
|
@@ -9186,26 +9149,26 @@ var ContextReplacementPlugin = create2(
|
|
9186
9149
|
);
|
9187
9150
|
|
9188
9151
|
// src/builtin-plugin/LibManifestPlugin.ts
|
9189
|
-
var
|
9152
|
+
var import_binding73 = require("@rspack/binding");
|
9190
9153
|
var LibManifestPlugin = create2(
|
9191
|
-
|
9154
|
+
import_binding73.BuiltinPluginName.LibManifestPlugin,
|
9192
9155
|
(options) => {
|
9193
|
-
const { context: context2, entryOnly, format: format3, name: name2, path:
|
9156
|
+
const { context: context2, entryOnly, format: format3, name: name2, path: path12, type } = options;
|
9194
9157
|
return {
|
9195
9158
|
context: context2,
|
9196
9159
|
entryOnly,
|
9197
9160
|
format: format3,
|
9198
9161
|
name: name2,
|
9199
|
-
path:
|
9162
|
+
path: path12,
|
9200
9163
|
type
|
9201
9164
|
};
|
9202
9165
|
}
|
9203
9166
|
);
|
9204
9167
|
|
9205
9168
|
// src/builtin-plugin/DllEntryPlugin.ts
|
9206
|
-
var
|
9169
|
+
var import_binding74 = require("@rspack/binding");
|
9207
9170
|
var DllEntryPlugin = create2(
|
9208
|
-
|
9171
|
+
import_binding74.BuiltinPluginName.DllEntryPlugin,
|
9209
9172
|
(context2, entries, options) => {
|
9210
9173
|
return {
|
9211
9174
|
context: context2,
|
@@ -9216,14 +9179,14 @@ var DllEntryPlugin = create2(
|
|
9216
9179
|
);
|
9217
9180
|
|
9218
9181
|
// src/builtin-plugin/DllReferenceAgencyPlugin.ts
|
9219
|
-
var
|
9182
|
+
var import_binding75 = require("@rspack/binding");
|
9220
9183
|
var DllReferenceAgencyPlugin = create2(
|
9221
|
-
|
9184
|
+
import_binding75.BuiltinPluginName.DllReferenceAgencyPlugin,
|
9222
9185
|
(options) => options
|
9223
9186
|
);
|
9224
9187
|
|
9225
9188
|
// src/builtin-plugin/RsdoctorPlugin.ts
|
9226
|
-
var
|
9189
|
+
var import_binding76 = require("@rspack/binding");
|
9227
9190
|
var liteTapable8 = __toESM(require("@rspack/lite-tapable"));
|
9228
9191
|
var import_zod3 = require("../compiled/zod/index.js");
|
9229
9192
|
var rsdoctorPluginSchema = import_zod3.z.strictObject({
|
@@ -9231,7 +9194,7 @@ var rsdoctorPluginSchema = import_zod3.z.strictObject({
|
|
9231
9194
|
chunkGraphFeatures: import_zod3.z.union([import_zod3.z.boolean(), import_zod3.z.array(import_zod3.z.enum(["graph", "assets"]))]).optional()
|
9232
9195
|
});
|
9233
9196
|
var RsdoctorPluginImpl = create2(
|
9234
|
-
|
9197
|
+
import_binding76.BuiltinPluginName.RsdoctorPlugin,
|
9235
9198
|
function(c = {
|
9236
9199
|
moduleGraphFeatures: true,
|
9237
9200
|
chunkGraphFeatures: true
|
@@ -9267,7 +9230,7 @@ RsdoctorPlugin.getHooks = RsdoctorPlugin.getCompilationHooks = (compilation) =>
|
|
9267
9230
|
var createRsdoctorPluginHooksRegisters = (getCompiler, createTap, createMapTap) => {
|
9268
9231
|
return {
|
9269
9232
|
registerRsdoctorPluginModuleGraphTaps: createTap(
|
9270
|
-
|
9233
|
+
import_binding76.RegisterJsTapKind.RsdoctorPluginModuleGraph,
|
9271
9234
|
function() {
|
9272
9235
|
return RsdoctorPlugin.getCompilationHooks(
|
9273
9236
|
getCompiler().__internal__get_compilation()
|
@@ -9280,7 +9243,7 @@ var createRsdoctorPluginHooksRegisters = (getCompiler, createTap, createMapTap)
|
|
9280
9243
|
}
|
9281
9244
|
),
|
9282
9245
|
registerRsdoctorPluginChunkGraphTaps: createTap(
|
9283
|
-
|
9246
|
+
import_binding76.RegisterJsTapKind.RsdoctorPluginChunkGraph,
|
9284
9247
|
function() {
|
9285
9248
|
return RsdoctorPlugin.getCompilationHooks(
|
9286
9249
|
getCompiler().__internal__get_compilation()
|
@@ -9293,7 +9256,7 @@ var createRsdoctorPluginHooksRegisters = (getCompiler, createTap, createMapTap)
|
|
9293
9256
|
}
|
9294
9257
|
),
|
9295
9258
|
registerRsdoctorPluginModuleIdsTaps: createTap(
|
9296
|
-
|
9259
|
+
import_binding76.RegisterJsTapKind.RsdoctorPluginModuleIds,
|
9297
9260
|
function() {
|
9298
9261
|
return RsdoctorPlugin.getCompilationHooks(
|
9299
9262
|
getCompiler().__internal__get_compilation()
|
@@ -9306,7 +9269,7 @@ var createRsdoctorPluginHooksRegisters = (getCompiler, createTap, createMapTap)
|
|
9306
9269
|
}
|
9307
9270
|
),
|
9308
9271
|
registerRsdoctorPluginModuleSourcesTaps: createTap(
|
9309
|
-
|
9272
|
+
import_binding76.RegisterJsTapKind.RsdoctorPluginModuleSources,
|
9310
9273
|
function() {
|
9311
9274
|
return RsdoctorPlugin.getCompilationHooks(
|
9312
9275
|
getCompiler().__internal__get_compilation()
|
@@ -9319,7 +9282,7 @@ var createRsdoctorPluginHooksRegisters = (getCompiler, createTap, createMapTap)
|
|
9319
9282
|
}
|
9320
9283
|
),
|
9321
9284
|
registerRsdoctorPluginAssetsTaps: createTap(
|
9322
|
-
|
9285
|
+
import_binding76.RegisterJsTapKind.RsdoctorPluginAssets,
|
9323
9286
|
function() {
|
9324
9287
|
return RsdoctorPlugin.getCompilationHooks(
|
9325
9288
|
getCompiler().__internal__get_compilation()
|
@@ -9337,8 +9300,8 @@ var createRsdoctorPluginHooksRegisters = (getCompiler, createTap, createMapTap)
|
|
9337
9300
|
// src/builtin-plugin/SubresourceIntegrityPlugin.ts
|
9338
9301
|
var import_node_crypto2 = require("crypto");
|
9339
9302
|
var import_node_fs2 = require("fs");
|
9340
|
-
var
|
9341
|
-
var
|
9303
|
+
var import_node_path8 = require("path");
|
9304
|
+
var import_binding77 = require("@rspack/binding");
|
9342
9305
|
var import_zod4 = require("../compiled/zod/index.js");
|
9343
9306
|
var PLUGIN_NAME2 = "SubresourceIntegrityPlugin";
|
9344
9307
|
var NATIVE_HTML_PLUGIN = "HtmlRspackPlugin";
|
@@ -9349,7 +9312,7 @@ var pluginOptionsSchema2 = import_zod4.z.object({
|
|
9349
9312
|
enabled: import_zod4.z.literal("auto").or(import_zod4.z.boolean()).optional()
|
9350
9313
|
});
|
9351
9314
|
var NativeSubresourceIntegrityPlugin = create2(
|
9352
|
-
|
9315
|
+
import_binding77.BuiltinPluginName.SubresourceIntegrityPlugin,
|
9353
9316
|
function(options) {
|
9354
9317
|
let htmlPlugin = "Disabled";
|
9355
9318
|
if (options.htmlPlugin === NATIVE_HTML_PLUGIN) {
|
@@ -9419,7 +9382,7 @@ var SubresourceIntegrityPlugin = class extends NativeSubresourceIntegrityPlugin
|
|
9419
9382
|
for (const asset of assets.js) {
|
9420
9383
|
jsIntegrity.push(
|
9421
9384
|
this.getIntegrityChecksumForAsset(
|
9422
|
-
(0,
|
9385
|
+
(0, import_node_path8.relative)(publicPath2, decodeURIComponent(asset))
|
9423
9386
|
)
|
9424
9387
|
);
|
9425
9388
|
}
|
@@ -9427,7 +9390,7 @@ var SubresourceIntegrityPlugin = class extends NativeSubresourceIntegrityPlugin
|
|
9427
9390
|
for (const asset of assets.css) {
|
9428
9391
|
cssIntegrity.push(
|
9429
9392
|
this.getIntegrityChecksumForAsset(
|
9430
|
-
(0,
|
9393
|
+
(0, import_node_path8.relative)(publicPath2, decodeURIComponent(asset))
|
9431
9394
|
)
|
9432
9395
|
);
|
9433
9396
|
}
|
@@ -9447,10 +9410,10 @@ var SubresourceIntegrityPlugin = class extends NativeSubresourceIntegrityPlugin
|
|
9447
9410
|
if (!tagSrc) {
|
9448
9411
|
return;
|
9449
9412
|
}
|
9450
|
-
const src = (0,
|
9413
|
+
const src = (0, import_node_path8.relative)(publicPath2, decodeURIComponent(tagSrc));
|
9451
9414
|
tag.attributes.integrity = this.getIntegrityChecksumForAsset(src) || computeIntegrity(
|
9452
9415
|
this.options.hashFuncNames,
|
9453
|
-
(0, import_node_fs2.readFileSync)((0,
|
9416
|
+
(0, import_node_fs2.readFileSync)((0, import_node_path8.join)(outputPath, src))
|
9454
9417
|
);
|
9455
9418
|
tag.attributes.crossorigin = crossOriginLoading2 || "anonymous";
|
9456
9419
|
}
|
@@ -9550,14 +9513,14 @@ function computeIntegrity(hashFuncNames, source) {
|
|
9550
9513
|
).join(" ");
|
9551
9514
|
return result2;
|
9552
9515
|
}
|
9553
|
-
function normalizePath(
|
9554
|
-
return
|
9516
|
+
function normalizePath(path12) {
|
9517
|
+
return path12.replace(/\?.*$/, "").split(import_node_path8.sep).join("/");
|
9555
9518
|
}
|
9556
9519
|
|
9557
9520
|
// src/builtin-plugin/ModuleInfoHeaderPlugin.ts
|
9558
|
-
var
|
9521
|
+
var import_binding78 = require("@rspack/binding");
|
9559
9522
|
var ModuleInfoHeaderPlugin = create2(
|
9560
|
-
|
9523
|
+
import_binding78.BuiltinPluginName.ModuleInfoHeaderPlugin,
|
9561
9524
|
(verbose) => verbose,
|
9562
9525
|
"compilation"
|
9563
9526
|
);
|
@@ -9896,13 +9859,13 @@ __export(browserslistTargetHandler_exports, {
|
|
9896
9859
|
load: () => load,
|
9897
9860
|
resolve: () => resolve
|
9898
9861
|
});
|
9899
|
-
var
|
9862
|
+
var import_node_path9 = __toESM(require("path"));
|
9900
9863
|
var inputRx = /^(?:((?:[A-Z]:)?[/\\].*?))?(?::(.+?))?$/i;
|
9901
9864
|
var parse = (input, context2) => {
|
9902
9865
|
if (!input) {
|
9903
9866
|
return {};
|
9904
9867
|
}
|
9905
|
-
if (
|
9868
|
+
if (import_node_path9.default.isAbsolute(input)) {
|
9906
9869
|
const [, configPath, env] = inputRx.exec(input) || [];
|
9907
9870
|
return { configPath, env };
|
9908
9871
|
}
|
@@ -10501,7 +10464,8 @@ var applyRspackOptionsDefaults = (options) => {
|
|
10501
10464
|
options.output.library
|
10502
10465
|
);
|
10503
10466
|
applyExternalsPresetsDefaults(options.externalsPresets, {
|
10504
|
-
targetProperties
|
10467
|
+
targetProperties,
|
10468
|
+
buildHttp: Boolean(options.experiments.buildHttp)
|
10505
10469
|
});
|
10506
10470
|
F(options, "externalsType", () => {
|
10507
10471
|
return options.output.library ? (
|
@@ -10564,6 +10528,10 @@ var applyExperimentsDefaults = (experiments3, { production, development }) => {
|
|
10564
10528
|
D(experiments3, "css", experiments3.futureDefaults ? true : void 0);
|
10565
10529
|
D(experiments3, "layers", false);
|
10566
10530
|
D(experiments3, "topLevelAwait", true);
|
10531
|
+
D(experiments3, "buildHttp", void 0);
|
10532
|
+
if (experiments3.buildHttp && typeof experiments3.buildHttp === "object") {
|
10533
|
+
D(experiments3.buildHttp, "upgrade", false);
|
10534
|
+
}
|
10567
10535
|
D(experiments3, "incremental", !production ? {} : false);
|
10568
10536
|
if (typeof experiments3.incremental === "object") {
|
10569
10537
|
D(experiments3.incremental, "make", true);
|
@@ -10583,7 +10551,7 @@ var applyExperimentsDefaults = (experiments3, { production, development }) => {
|
|
10583
10551
|
D(experiments3.incremental, "emitAssets", true);
|
10584
10552
|
}
|
10585
10553
|
D(experiments3, "rspackFuture", {});
|
10586
|
-
D(experiments3, "parallelCodeSplitting",
|
10554
|
+
D(experiments3, "parallelCodeSplitting", true);
|
10587
10555
|
};
|
10588
10556
|
var applybundlerInfoDefaults = (rspackFuture, library3) => {
|
10589
10557
|
if (typeof rspackFuture === "object") {
|
@@ -10846,7 +10814,7 @@ var applyOutputDefaults = (output2, {
|
|
10846
10814
|
}
|
10847
10815
|
);
|
10848
10816
|
if (libraryName2) return libraryName2;
|
10849
|
-
const pkgPath =
|
10817
|
+
const pkgPath = import_node_path10.default.resolve(context2, "package.json");
|
10850
10818
|
try {
|
10851
10819
|
const packageInfo = JSON.parse(import_node_fs3.default.readFileSync(pkgPath, "utf-8"));
|
10852
10820
|
return packageInfo.name || "";
|
@@ -10902,7 +10870,7 @@ while determining default 'output.uniqueName' from 'name' in ${pkgPath}`;
|
|
10902
10870
|
D(output2, "assetModuleFilename", "[hash][ext][query]");
|
10903
10871
|
D(output2, "webassemblyModuleFilename", "[hash].module.wasm");
|
10904
10872
|
D(output2, "compareBeforeEmit", true);
|
10905
|
-
F(output2, "path", () =>
|
10873
|
+
F(output2, "path", () => import_node_path10.default.join(process.cwd(), "dist"));
|
10906
10874
|
F(output2, "pathinfo", () => development);
|
10907
10875
|
D(
|
10908
10876
|
output2,
|
@@ -11105,8 +11073,8 @@ ${helpMessage}`
|
|
11105
11073
|
);
|
11106
11074
|
F(environment2, "document", () => tp && optimistic(tp.document));
|
11107
11075
|
};
|
11108
|
-
var applyExternalsPresetsDefaults = (externalsPresets2, { targetProperties }) => {
|
11109
|
-
D(externalsPresets2, "web", targetProperties == null ? void 0 : targetProperties.web);
|
11076
|
+
var applyExternalsPresetsDefaults = (externalsPresets2, { targetProperties, buildHttp }) => {
|
11077
|
+
D(externalsPresets2, "web", !buildHttp && (targetProperties == null ? void 0 : targetProperties.web));
|
11110
11078
|
D(externalsPresets2, "node", targetProperties == null ? void 0 : targetProperties.node);
|
11111
11079
|
D(externalsPresets2, "electron", targetProperties == null ? void 0 : targetProperties.electron);
|
11112
11080
|
D(
|
@@ -11173,7 +11141,7 @@ var applyOptimizationDefaults = (optimization2, {
|
|
11173
11141
|
development,
|
11174
11142
|
css
|
11175
11143
|
}) => {
|
11176
|
-
D(optimization2, "removeAvailableModules",
|
11144
|
+
D(optimization2, "removeAvailableModules", true);
|
11177
11145
|
D(optimization2, "removeEmptyChunks", true);
|
11178
11146
|
D(optimization2, "mergeDuplicateChunks", true);
|
11179
11147
|
F(optimization2, "moduleIds", () => {
|
@@ -11377,7 +11345,7 @@ var getPnpDefault = () => {
|
|
11377
11345
|
};
|
11378
11346
|
|
11379
11347
|
// src/config/normalization.ts
|
11380
|
-
var
|
11348
|
+
var import_node_path11 = __toESM(require("path"));
|
11381
11349
|
var import_node_util5 = __toESM(require("util"));
|
11382
11350
|
var getNormalizedRspackOptions = (config2) => {
|
11383
11351
|
return {
|
@@ -11567,7 +11535,7 @@ var getNormalizedRspackOptions = (config2) => {
|
|
11567
11535
|
type: "persistent",
|
11568
11536
|
buildDependencies: nestedArray(
|
11569
11537
|
cache.buildDependencies,
|
11570
|
-
(deps) => deps.map((d) =>
|
11538
|
+
(deps) => deps.map((d) => import_node_path11.default.resolve(config2.context || process.cwd(), d))
|
11571
11539
|
),
|
11572
11540
|
version: cache.version || "",
|
11573
11541
|
snapshot: {
|
@@ -11579,7 +11547,7 @@ var getNormalizedRspackOptions = (config2) => {
|
|
11579
11547
|
},
|
11580
11548
|
storage: {
|
11581
11549
|
type: "filesystem",
|
11582
|
-
directory:
|
11550
|
+
directory: import_node_path11.default.resolve(
|
11583
11551
|
config2.context || process.cwd(),
|
11584
11552
|
((_a = cache.storage) == null ? void 0 : _a.directory) || "node_modules/.cache/rspack"
|
11585
11553
|
)
|
@@ -11610,7 +11578,8 @@ var getNormalizedRspackOptions = (config2) => {
|
|
11610
11578
|
emitAssets: true
|
11611
11579
|
} : options
|
11612
11580
|
),
|
11613
|
-
parallelCodeSplitting: experiments3.parallelCodeSplitting
|
11581
|
+
parallelCodeSplitting: experiments3.parallelCodeSplitting,
|
11582
|
+
buildHttp: experiments3.buildHttp
|
11614
11583
|
})),
|
11615
11584
|
watch: config2.watch,
|
11616
11585
|
watchOptions: cloneObject(config2.watchOptions),
|
@@ -11716,14 +11685,14 @@ var Resolver = class _Resolver {
|
|
11716
11685
|
constructor(binding14) {
|
11717
11686
|
this.binding = binding14;
|
11718
11687
|
}
|
11719
|
-
resolveSync(context2,
|
11720
|
-
const data = this.binding.resolveSync(
|
11688
|
+
resolveSync(context2, path12, request) {
|
11689
|
+
const data = this.binding.resolveSync(path12, request);
|
11721
11690
|
if (data === false) return data;
|
11722
11691
|
return data.resource;
|
11723
11692
|
}
|
11724
|
-
resolve(context2,
|
11693
|
+
resolve(context2, path12, request, resolveContext, callback) {
|
11725
11694
|
try {
|
11726
|
-
const data = this.binding.resolveSync(
|
11695
|
+
const data = this.binding.resolveSync(path12, request);
|
11727
11696
|
if (data === false) {
|
11728
11697
|
callback(null, false);
|
11729
11698
|
return;
|
@@ -11905,8 +11874,19 @@ var Watching = class {
|
|
11905
11874
|
this.onChange();
|
11906
11875
|
this.#invalidate();
|
11907
11876
|
}
|
11908
|
-
|
11909
|
-
|
11877
|
+
/**
|
11878
|
+
* @internal This is not a public API yet, still unstable, might change in the future
|
11879
|
+
*/
|
11880
|
+
invalidateWithChangesAndRemovals(changedFiles, removedFiles, callback) {
|
11881
|
+
if (callback) {
|
11882
|
+
this.callbacks.push(callback);
|
11883
|
+
}
|
11884
|
+
if (!this.#invalidReported) {
|
11885
|
+
this.#invalidReported = true;
|
11886
|
+
this.compiler.hooks.invalid.call(null, Date.now());
|
11887
|
+
}
|
11888
|
+
this.onChange();
|
11889
|
+
this.#invalidate(void 0, void 0, changedFiles, removedFiles);
|
11910
11890
|
}
|
11911
11891
|
#invalidate(fileTimeInfoEntries, contextTimeInfoEntries, changedFiles, removedFiles) {
|
11912
11892
|
this.#mergeWithCollected(changedFiles, removedFiles);
|
@@ -12027,16 +12007,18 @@ var Watching = class {
|
|
12027
12007
|
});
|
12028
12008
|
}
|
12029
12009
|
#mergeWithCollected(changedFiles, removedFiles) {
|
12030
|
-
if (!changedFiles) return;
|
12031
|
-
if (!removedFiles) return;
|
12032
12010
|
if (!this.#collectedChangedFiles || !this.#collectedRemovedFiles) {
|
12033
12011
|
this.#collectedChangedFiles = new Set(changedFiles);
|
12034
12012
|
this.#collectedRemovedFiles = new Set(removedFiles);
|
12035
|
-
|
12013
|
+
return;
|
12014
|
+
}
|
12015
|
+
if (changedFiles) {
|
12036
12016
|
for (const file of changedFiles) {
|
12037
12017
|
this.#collectedChangedFiles.add(file);
|
12038
12018
|
this.#collectedRemovedFiles.delete(file);
|
12039
12019
|
}
|
12020
|
+
}
|
12021
|
+
if (removedFiles) {
|
12040
12022
|
for (const file of removedFiles) {
|
12041
12023
|
this.#collectedChangedFiles.delete(file);
|
12042
12024
|
this.#collectedRemovedFiles.add(file);
|
@@ -12056,7 +12038,7 @@ var Watching = class {
|
|
12056
12038
|
|
12057
12039
|
// src/util/bindingVersionCheck.ts
|
12058
12040
|
var import_node_fs4 = require("fs");
|
12059
|
-
var
|
12041
|
+
var import_node_path12 = __toESM(require("path"));
|
12060
12042
|
var NodePlatformArchToAbi = {
|
12061
12043
|
android: {
|
12062
12044
|
arm64: "",
|
@@ -12128,7 +12110,7 @@ var checkVersion = () => {
|
|
12128
12110
|
}
|
12129
12111
|
let ADDON_VERSION;
|
12130
12112
|
try {
|
12131
|
-
const BINDING_PKG_DIR =
|
12113
|
+
const BINDING_PKG_DIR = import_node_path12.default.dirname(
|
12132
12114
|
require.resolve("@rspack/binding/package.json")
|
12133
12115
|
);
|
12134
12116
|
const isLocal = (0, import_node_fs4.readdirSync)(BINDING_PKG_DIR).some(
|
@@ -12304,7 +12286,7 @@ var binding6 = __toESM(require("@rspack/binding"));
|
|
12304
12286
|
|
12305
12287
|
// src/Module.ts
|
12306
12288
|
var binding5 = __toESM(require("@rspack/binding"));
|
12307
|
-
var
|
12289
|
+
var import_binding79 = require("@rspack/binding");
|
12308
12290
|
var ContextModuleFactoryBeforeResolveData = class _ContextModuleFactoryBeforeResolveData {
|
12309
12291
|
#inner;
|
12310
12292
|
static __from_binding(binding14) {
|
@@ -15201,17 +15183,17 @@ var ASSETS_GROUPERS = {
|
|
15201
15183
|
const extensionMatch = groupAssetsByExtension && GROUP_EXTENSION_REGEXP.exec(asset.name);
|
15202
15184
|
const extension = extensionMatch ? extensionMatch[1] : "";
|
15203
15185
|
const pathMatch = groupAssetsByPath && GROUP_PATH_REGEXP.exec(asset.name);
|
15204
|
-
const
|
15186
|
+
const path12 = pathMatch ? pathMatch[1].split(/[/\\]/) : [];
|
15205
15187
|
const keys = [];
|
15206
15188
|
if (groupAssetsByPath) {
|
15207
15189
|
keys.push(".");
|
15208
15190
|
if (extension)
|
15209
15191
|
keys.push(
|
15210
|
-
|
15192
|
+
path12.length ? `${path12.join("/")}/*${extension}` : `*${extension}`
|
15211
15193
|
);
|
15212
|
-
while (
|
15213
|
-
keys.push(`${
|
15214
|
-
|
15194
|
+
while (path12.length > 0) {
|
15195
|
+
keys.push(`${path12.join("/")}/`);
|
15196
|
+
path12.pop();
|
15215
15197
|
}
|
15216
15198
|
} else {
|
15217
15199
|
if (extension) keys.push(`*${extension}`);
|
@@ -15397,16 +15379,16 @@ var MODULES_GROUPERS = (type) => ({
|
|
15397
15379
|
const extensionMatch = groupModulesByExtension && GROUP_EXTENSION_REGEXP.exec(resource);
|
15398
15380
|
const extension = extensionMatch ? extensionMatch[1] : "";
|
15399
15381
|
const pathMatch = groupModulesByPath && GROUP_PATH_REGEXP.exec(resource);
|
15400
|
-
const
|
15382
|
+
const path12 = pathMatch ? pathMatch[1].split(/[/\\]/) : [];
|
15401
15383
|
const keys = [];
|
15402
15384
|
if (groupModulesByPath) {
|
15403
15385
|
if (extension)
|
15404
15386
|
keys.push(
|
15405
|
-
|
15387
|
+
path12.length ? `${path12.join("/")}/*${extension}` : `*${extension}`
|
15406
15388
|
);
|
15407
|
-
while (
|
15408
|
-
keys.push(`${
|
15409
|
-
|
15389
|
+
while (path12.length > 0) {
|
15390
|
+
keys.push(`${path12.join("/")}/`);
|
15391
|
+
path12.pop();
|
15410
15392
|
}
|
15411
15393
|
} else {
|
15412
15394
|
if (extension) keys.push(`*${extension}`);
|
@@ -17847,6 +17829,9 @@ var RspackOptionsApply = class {
|
|
17847
17829
|
new APIPlugin().apply(compiler);
|
17848
17830
|
new DataUriPlugin().apply(compiler);
|
17849
17831
|
new FileUriPlugin().apply(compiler);
|
17832
|
+
if (options.experiments.buildHttp) {
|
17833
|
+
new HttpUriPlugin(options.experiments.buildHttp).apply(compiler);
|
17834
|
+
}
|
17850
17835
|
new EnsureChunkConditionsPlugin().apply(compiler);
|
17851
17836
|
if (options.optimization.mergeDuplicateChunks) {
|
17852
17837
|
new MergeDuplicateChunksPlugin().apply(compiler);
|
@@ -17874,21 +17859,6 @@ var RspackOptionsApply = class {
|
|
17874
17859
|
options.optimization.mangleExports !== "size"
|
17875
17860
|
).apply(compiler);
|
17876
17861
|
}
|
17877
|
-
if (options.experiments.lazyCompilation) {
|
17878
|
-
const lazyOptions = options.experiments.lazyCompilation;
|
17879
|
-
new LazyCompilationPlugin(
|
17880
|
-
// this is only for test
|
17881
|
-
// @ts-expect-error cacheable is hide
|
17882
|
-
lazyOptions.cacheable ?? true,
|
17883
|
-
lazyOptions.entries ?? true,
|
17884
|
-
lazyOptions.imports ?? true,
|
17885
|
-
typeof lazyOptions.test === "function" ? (module2) => lazyOptions.test.call(
|
17886
|
-
lazyOptions,
|
17887
|
-
module2
|
17888
|
-
) : lazyOptions.test,
|
17889
|
-
lazyOptions.backend
|
17890
|
-
).apply(compiler);
|
17891
|
-
}
|
17892
17862
|
if (options.output.enabledLibraryTypes && options.output.enabledLibraryTypes.length > 0) {
|
17893
17863
|
for (const type of options.output.enabledLibraryTypes) {
|
17894
17864
|
new EnableLibraryPlugin(type).apply(compiler);
|
@@ -17996,7 +17966,7 @@ var RspackOptionsApply = class {
|
|
17996
17966
|
|
17997
17967
|
// src/ContextModule.ts
|
17998
17968
|
var binding11 = __toESM(require("@rspack/binding"));
|
17999
|
-
var
|
17969
|
+
var import_binding80 = require("@rspack/binding");
|
18000
17970
|
Object.defineProperty(binding11.ContextModule.prototype, "originalSource", {
|
18001
17971
|
enumerable: true,
|
18002
17972
|
configurable: true,
|
@@ -18018,7 +17988,7 @@ Object.defineProperty(binding11.ContextModule.prototype, "emitFile", {
|
|
18018
17988
|
|
18019
17989
|
// src/ConcatenatedModule.ts
|
18020
17990
|
var binding12 = __toESM(require("@rspack/binding"));
|
18021
|
-
var
|
17991
|
+
var import_binding81 = require("@rspack/binding");
|
18022
17992
|
Object.defineProperty(binding12.ConcatenatedModule.prototype, "originalSource", {
|
18023
17993
|
enumerable: true,
|
18024
17994
|
configurable: true,
|
@@ -18040,7 +18010,7 @@ Object.defineProperty(binding12.ConcatenatedModule.prototype, "emitFile", {
|
|
18040
18010
|
|
18041
18011
|
// src/ExternalModule.ts
|
18042
18012
|
var binding13 = __toESM(require("@rspack/binding"));
|
18043
|
-
var
|
18013
|
+
var import_binding82 = require("@rspack/binding");
|
18044
18014
|
Object.defineProperty(binding13.ExternalModule.prototype, "originalSource", {
|
18045
18015
|
enumerable: true,
|
18046
18016
|
configurable: true,
|
@@ -18061,7 +18031,7 @@ Object.defineProperty(binding13.ExternalModule.prototype, "emitFile", {
|
|
18061
18031
|
});
|
18062
18032
|
|
18063
18033
|
// src/exports.ts
|
18064
|
-
var
|
18034
|
+
var import_binding90 = require("@rspack/binding");
|
18065
18035
|
|
18066
18036
|
// src/lib/ModuleFilenameHelpers.ts
|
18067
18037
|
var ModuleFilenameHelpers_exports = {};
|
@@ -18106,9 +18076,9 @@ var matchObject = (obj, str) => {
|
|
18106
18076
|
var import_zod5 = __toESM(require("../compiled/zod/index.js"));
|
18107
18077
|
|
18108
18078
|
// src/builtin-plugin/FlagAllModulesAsUsedPlugin.ts
|
18109
|
-
var
|
18079
|
+
var import_binding83 = require("@rspack/binding");
|
18110
18080
|
var FlagAllModulesAsUsedPlugin = create2(
|
18111
|
-
|
18081
|
+
import_binding83.BuiltinPluginName.FlagAllModulesAsUsedPlugin,
|
18112
18082
|
(explanation) => {
|
18113
18083
|
return {
|
18114
18084
|
explanation
|
@@ -18997,7 +18967,7 @@ var NodeTemplatePlugin = class {
|
|
18997
18967
|
};
|
18998
18968
|
|
18999
18969
|
// src/config/zod.ts
|
19000
|
-
var
|
18970
|
+
var import_node_path13 = __toESM(require("path"));
|
19001
18971
|
var import_zod8 = require("../compiled/zod/index.js");
|
19002
18972
|
|
19003
18973
|
// src/config/utils.ts
|
@@ -19155,7 +19125,7 @@ var filename = filenameTemplate.or(
|
|
19155
19125
|
var name = import_zod8.z.string();
|
19156
19126
|
var dependencies = import_zod8.z.array(name);
|
19157
19127
|
var context = import_zod8.z.string().refine(
|
19158
|
-
(val) =>
|
19128
|
+
(val) => import_node_path13.default.isAbsolute(val),
|
19159
19129
|
(val) => ({
|
19160
19130
|
message: `The provided value ${JSON.stringify(val)} must be an absolute path.`
|
19161
19131
|
})
|
@@ -19254,7 +19224,7 @@ var entryDynamic = import_zod8.z.function().returns(
|
|
19254
19224
|
entryStatic.or(import_zod8.z.promise(entryStatic))
|
19255
19225
|
);
|
19256
19226
|
var entry = entryStatic.or(entryDynamic);
|
19257
|
-
var
|
19227
|
+
var path11 = import_zod8.z.string();
|
19258
19228
|
var pathinfo = import_zod8.z.boolean().or(import_zod8.z.literal("verbose"));
|
19259
19229
|
var assetModuleFilename = filename;
|
19260
19230
|
var webassemblyModuleFilename = import_zod8.z.string();
|
@@ -19328,7 +19298,7 @@ var environment = import_zod8.z.strictObject({
|
|
19328
19298
|
templateLiteral: import_zod8.z.boolean().optional()
|
19329
19299
|
});
|
19330
19300
|
var output = import_zod8.z.strictObject({
|
19331
|
-
path:
|
19301
|
+
path: path11.optional(),
|
19332
19302
|
pathinfo: pathinfo.optional(),
|
19333
19303
|
clean: clean.optional(),
|
19334
19304
|
publicPath: publicPath.optional(),
|
@@ -19384,7 +19354,7 @@ var output = import_zod8.z.strictObject({
|
|
19384
19354
|
});
|
19385
19355
|
var resolveAlias = import_zod8.z.record(
|
19386
19356
|
import_zod8.z.literal(false).or(import_zod8.z.string()).or(import_zod8.z.array(import_zod8.z.string().or(import_zod8.z.literal(false))))
|
19387
|
-
);
|
19357
|
+
).or(import_zod8.z.literal(false));
|
19388
19358
|
var resolveTsConfigFile = import_zod8.z.string();
|
19389
19359
|
var resolveTsConfig = resolveTsConfigFile.or(
|
19390
19360
|
import_zod8.z.strictObject({
|
@@ -19965,7 +19935,7 @@ var optimizationRuntimeChunk = import_zod8.z.enum(["single", "multiple"]).or(imp
|
|
19965
19935
|
).optional()
|
19966
19936
|
})
|
19967
19937
|
);
|
19968
|
-
var optimizationSplitChunksNameFunction = import_zod8.z.function().args(import_zod8.z.instanceof(
|
19938
|
+
var optimizationSplitChunksNameFunction = import_zod8.z.function().args(import_zod8.z.instanceof(import_binding79.Module), import_zod8.z.array(import_zod8.z.instanceof(Chunk)), import_zod8.z.string()).returns(
|
19969
19939
|
import_zod8.z.string().optional()
|
19970
19940
|
);
|
19971
19941
|
var optimizationSplitChunksName = import_zod8.z.string().or(import_zod8.z.literal(false)).or(optimizationSplitChunksNameFunction);
|
@@ -19992,7 +19962,7 @@ var sharedOptimizationSplitChunksCacheGroup = {
|
|
19992
19962
|
var optimizationSplitChunksCacheGroup = import_zod8.z.strictObject({
|
19993
19963
|
test: import_zod8.z.string().or(import_zod8.z.instanceof(RegExp)).or(
|
19994
19964
|
import_zod8.z.function().args(
|
19995
|
-
import_zod8.z.instanceof(
|
19965
|
+
import_zod8.z.instanceof(import_binding79.Module),
|
19996
19966
|
import_zod8.z.object({
|
19997
19967
|
moduleGraph: import_zod8.z.instanceof(ModuleGraph),
|
19998
19968
|
chunkGraph: import_zod8.z.instanceof(ChunkGraph)
|
@@ -20048,16 +20018,6 @@ var rspackFutureOptions = import_zod8.z.strictObject({
|
|
20048
20018
|
force: import_zod8.z.boolean().or(import_zod8.z.array(import_zod8.z.enum(["version", "uniqueId"]))).optional()
|
20049
20019
|
}).optional()
|
20050
20020
|
});
|
20051
|
-
var listenOptions = import_zod8.z.object({
|
20052
|
-
port: import_zod8.z.number().optional(),
|
20053
|
-
host: import_zod8.z.string().optional(),
|
20054
|
-
backlog: import_zod8.z.number().optional(),
|
20055
|
-
path: import_zod8.z.string().optional(),
|
20056
|
-
exclusive: import_zod8.z.boolean().optional(),
|
20057
|
-
readableAll: import_zod8.z.boolean().optional(),
|
20058
|
-
writableAll: import_zod8.z.boolean().optional(),
|
20059
|
-
ipv6Only: import_zod8.z.boolean().optional()
|
20060
|
-
});
|
20061
20021
|
var experimentCacheOptions = import_zod8.z.object({
|
20062
20022
|
type: import_zod8.z.enum(["memory"])
|
20063
20023
|
}).or(
|
@@ -20077,15 +20037,11 @@ var experimentCacheOptions = import_zod8.z.object({
|
|
20077
20037
|
})
|
20078
20038
|
);
|
20079
20039
|
var lazyCompilationOptions = import_zod8.z.object({
|
20080
|
-
backend: import_zod8.z.object({
|
20081
|
-
client: import_zod8.z.string().optional(),
|
20082
|
-
listen: import_zod8.z.number().or(listenOptions).or(import_zod8.z.function().args(import_zod8.z.any()).returns(import_zod8.z.void())).optional(),
|
20083
|
-
protocol: import_zod8.z.enum(["http", "https"]).optional(),
|
20084
|
-
server: import_zod8.z.record(import_zod8.z.any()).or(import_zod8.z.function().returns(import_zod8.z.any())).optional()
|
20085
|
-
}).optional(),
|
20086
20040
|
imports: import_zod8.z.boolean().optional(),
|
20087
20041
|
entries: import_zod8.z.boolean().optional(),
|
20088
|
-
test: import_zod8.z.instanceof(RegExp).or(import_zod8.z.function().args(import_zod8.z.custom()).returns(import_zod8.z.boolean())).optional()
|
20042
|
+
test: import_zod8.z.instanceof(RegExp).or(import_zod8.z.function().args(import_zod8.z.custom()).returns(import_zod8.z.boolean())).optional(),
|
20043
|
+
client: import_zod8.z.string().optional(),
|
20044
|
+
serverUrl: import_zod8.z.string().optional()
|
20089
20045
|
});
|
20090
20046
|
var incremental = import_zod8.z.strictObject({
|
20091
20047
|
make: import_zod8.z.boolean().optional(),
|
@@ -20104,6 +20060,23 @@ var incremental = import_zod8.z.strictObject({
|
|
20104
20060
|
chunksRender: import_zod8.z.boolean().optional(),
|
20105
20061
|
emitAssets: import_zod8.z.boolean().optional()
|
20106
20062
|
});
|
20063
|
+
var buildHttpOptions = import_zod8.z.object({
|
20064
|
+
allowedUris: import_zod8.z.array(import_zod8.z.union([import_zod8.z.string(), import_zod8.z.instanceof(RegExp)])),
|
20065
|
+
lockfileLocation: import_zod8.z.string().optional(),
|
20066
|
+
cacheLocation: import_zod8.z.union([import_zod8.z.string(), import_zod8.z.literal(false)]).optional(),
|
20067
|
+
upgrade: import_zod8.z.boolean().optional(),
|
20068
|
+
// proxy: z.string().optional(),
|
20069
|
+
// frozen: z.boolean().optional(),
|
20070
|
+
httpClient: import_zod8.z.function().args(import_zod8.z.string(), import_zod8.z.record(import_zod8.z.string())).returns(
|
20071
|
+
import_zod8.z.promise(
|
20072
|
+
import_zod8.z.object({
|
20073
|
+
status: import_zod8.z.number(),
|
20074
|
+
headers: import_zod8.z.record(import_zod8.z.string()),
|
20075
|
+
body: import_zod8.z.instanceof(Buffer)
|
20076
|
+
})
|
20077
|
+
)
|
20078
|
+
).optional()
|
20079
|
+
});
|
20107
20080
|
var experiments = import_zod8.z.strictObject({
|
20108
20081
|
cache: import_zod8.z.boolean().optional().or(experimentCacheOptions),
|
20109
20082
|
lazyCompilation: import_zod8.z.boolean().optional().or(lazyCompilationOptions),
|
@@ -20115,7 +20088,8 @@ var experiments = import_zod8.z.strictObject({
|
|
20115
20088
|
incremental: import_zod8.z.boolean().or(incremental).optional(),
|
20116
20089
|
parallelCodeSplitting: import_zod8.z.boolean().optional(),
|
20117
20090
|
futureDefaults: import_zod8.z.boolean().optional(),
|
20118
|
-
rspackFuture: rspackFutureOptions.optional()
|
20091
|
+
rspackFuture: rspackFutureOptions.optional(),
|
20092
|
+
buildHttp: buildHttpOptions.optional()
|
20119
20093
|
});
|
20120
20094
|
var watch = import_zod8.z.boolean();
|
20121
20095
|
var watchOptions = import_zod8.z.strictObject({
|
@@ -20174,9 +20148,9 @@ var rspackOptions = import_zod8.z.strictObject({
|
|
20174
20148
|
});
|
20175
20149
|
|
20176
20150
|
// src/container/ModuleFederationRuntimePlugin.ts
|
20177
|
-
var
|
20151
|
+
var import_binding84 = require("@rspack/binding");
|
20178
20152
|
var ModuleFederationRuntimePlugin = create2(
|
20179
|
-
|
20153
|
+
import_binding84.BuiltinPluginName.ModuleFederationRuntimePlugin,
|
20180
20154
|
() => {
|
20181
20155
|
}
|
20182
20156
|
);
|
@@ -20372,10 +20346,10 @@ function getDefaultEntryRuntime(paths, options, compiler) {
|
|
20372
20346
|
}
|
20373
20347
|
|
20374
20348
|
// src/sharing/ConsumeSharedPlugin.ts
|
20375
|
-
var
|
20349
|
+
var import_binding86 = require("@rspack/binding");
|
20376
20350
|
|
20377
20351
|
// src/sharing/ShareRuntimePlugin.ts
|
20378
|
-
var
|
20352
|
+
var import_binding85 = require("@rspack/binding");
|
20379
20353
|
var compilerSet = /* @__PURE__ */ new WeakSet();
|
20380
20354
|
function isSingleton(compiler) {
|
20381
20355
|
return compilerSet.has(compiler);
|
@@ -20387,7 +20361,7 @@ var ShareRuntimePlugin = class extends RspackBuiltinPlugin {
|
|
20387
20361
|
constructor(enhanced = false) {
|
20388
20362
|
super();
|
20389
20363
|
this.enhanced = enhanced;
|
20390
|
-
this.name =
|
20364
|
+
this.name = import_binding85.BuiltinPluginName.ShareRuntimePlugin;
|
20391
20365
|
}
|
20392
20366
|
raw(compiler) {
|
20393
20367
|
if (isSingleton(compiler)) return;
|
@@ -20406,7 +20380,7 @@ function isRequiredVersion(str) {
|
|
20406
20380
|
var ConsumeSharedPlugin = class extends RspackBuiltinPlugin {
|
20407
20381
|
constructor(options) {
|
20408
20382
|
super();
|
20409
|
-
this.name =
|
20383
|
+
this.name = import_binding86.BuiltinPluginName.ConsumeSharedPlugin;
|
20410
20384
|
this._options = {
|
20411
20385
|
consumes: parseOptions(
|
20412
20386
|
options.consumes,
|
@@ -20469,11 +20443,11 @@ var ConsumeSharedPlugin = class extends RspackBuiltinPlugin {
|
|
20469
20443
|
};
|
20470
20444
|
|
20471
20445
|
// src/sharing/ProvideSharedPlugin.ts
|
20472
|
-
var
|
20446
|
+
var import_binding87 = require("@rspack/binding");
|
20473
20447
|
var ProvideSharedPlugin = class extends RspackBuiltinPlugin {
|
20474
20448
|
constructor(options) {
|
20475
20449
|
super();
|
20476
|
-
this.name =
|
20450
|
+
this.name = import_binding87.BuiltinPluginName.ProvideSharedPlugin;
|
20477
20451
|
this._provides = parseOptions(
|
20478
20452
|
options.provides,
|
20479
20453
|
(item) => {
|
@@ -20578,11 +20552,11 @@ var SharePlugin = class {
|
|
20578
20552
|
};
|
20579
20553
|
|
20580
20554
|
// src/container/ContainerPlugin.ts
|
20581
|
-
var
|
20555
|
+
var import_binding88 = require("@rspack/binding");
|
20582
20556
|
var ContainerPlugin = class extends RspackBuiltinPlugin {
|
20583
20557
|
constructor(options) {
|
20584
20558
|
super();
|
20585
|
-
this.name =
|
20559
|
+
this.name = import_binding88.BuiltinPluginName.ContainerPlugin;
|
20586
20560
|
this._options = {
|
20587
20561
|
name: options.name,
|
20588
20562
|
shareScope: options.shareScope || "default",
|
@@ -20626,11 +20600,11 @@ var ContainerPlugin = class extends RspackBuiltinPlugin {
|
|
20626
20600
|
};
|
20627
20601
|
|
20628
20602
|
// src/container/ContainerReferencePlugin.ts
|
20629
|
-
var
|
20603
|
+
var import_binding89 = require("@rspack/binding");
|
20630
20604
|
var ContainerReferencePlugin = class extends RspackBuiltinPlugin {
|
20631
20605
|
constructor(options) {
|
20632
20606
|
super();
|
20633
|
-
this.name =
|
20607
|
+
this.name = import_binding89.BuiltinPluginName.ContainerReferencePlugin;
|
20634
20608
|
this._options = {
|
20635
20609
|
remoteType: options.remoteType,
|
20636
20610
|
remotes: parseOptions(
|
@@ -20715,7 +20689,7 @@ var ModuleFederationPluginV1 = class {
|
|
20715
20689
|
};
|
20716
20690
|
|
20717
20691
|
// src/exports.ts
|
20718
|
-
var
|
20692
|
+
var import_binding91 = require("@rspack/binding");
|
20719
20693
|
var rspackVersion = import_package.version;
|
20720
20694
|
var version = import_package.webpackVersion;
|
20721
20695
|
var WebpackError2 = Error;
|
@@ -20762,7 +20736,7 @@ var sharing = {
|
|
20762
20736
|
var experiments2 = {
|
20763
20737
|
globalTrace: {
|
20764
20738
|
async register(filter, layer2, output2) {
|
20765
|
-
(0,
|
20739
|
+
(0, import_binding91.registerGlobalTrace)(filter, layer2, output2);
|
20766
20740
|
if (layer2 === "otel") {
|
20767
20741
|
try {
|
20768
20742
|
const { initOpenTelemetry } = await import("@rspack/tracing");
|
@@ -20776,7 +20750,7 @@ var experiments2 = {
|
|
20776
20750
|
}
|
20777
20751
|
},
|
20778
20752
|
async cleanup() {
|
20779
|
-
(0,
|
20753
|
+
(0, import_binding91.cleanupGlobalTrace)();
|
20780
20754
|
try {
|
20781
20755
|
const { shutdownOpenTelemetry } = await import("@rspack/tracing");
|
20782
20756
|
await shutdownOpenTelemetry();
|
@@ -20791,7 +20765,8 @@ var experiments2 = {
|
|
20791
20765
|
* @internal
|
20792
20766
|
*/
|
20793
20767
|
RsdoctorPlugin,
|
20794
|
-
SubresourceIntegrityPlugin
|
20768
|
+
SubresourceIntegrityPlugin,
|
20769
|
+
lazyCompilationMiddleware
|
20795
20770
|
};
|
20796
20771
|
|
20797
20772
|
// src/rspack.ts
|
@@ -20905,6 +20880,7 @@ module.exports = rspack;
|
|
20905
20880
|
0 && (module.exports = {
|
20906
20881
|
AsyncDependenciesBlock,
|
20907
20882
|
BannerPlugin,
|
20883
|
+
CircularDependencyRspackPlugin,
|
20908
20884
|
Compilation,
|
20909
20885
|
Compiler,
|
20910
20886
|
ConcatenatedModule,
|