@rspack/core 1.1.8 → 1.2.0-alpha.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/compiled/@swc/types/index.d.ts +20 -5
- package/compiled/@swc/types/license +1 -1
- package/compiled/@swc/types/package.json +1 -1
- package/dist/Chunk.d.ts +21 -28
- package/dist/ChunkGraph.d.ts +8 -4
- package/dist/ChunkGroup.d.ts +13 -19
- package/dist/Compilation.d.ts +5 -0
- package/dist/Compiler.d.ts +1 -0
- package/dist/Entrypoint.d.ts +4 -3
- package/dist/ExportsInfo.d.ts +20 -0
- package/dist/FileSystem.d.ts +17 -17
- package/dist/Module.d.ts +1 -0
- package/dist/ModuleGraph.d.ts +6 -0
- package/dist/ModuleGraphConnection.d.ts +11 -0
- 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/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/DeterministicChunkIdsPlugin.d.ts +8 -10
- 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 +11 -3
- 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/HtmlRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/HttpExternalsRspackPlugin.d.ts +1 -1
- 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/NamedChunkIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NamedModuleIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NaturalChunkIdsPlugin.d.ts +8 -10
- 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 +10 -0
- 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/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/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/index.d.ts +1 -0
- package/dist/builtin-plugin/lazy-compilation/lazyCompilation.d.ts +1 -1
- package/dist/config/adapter.d.ts +2 -4
- package/dist/config/adapterRuleUse.d.ts +32 -8
- package/dist/config/normalization.d.ts +18 -2
- package/dist/config/types.d.ts +32 -10
- package/dist/config/zod.d.ts +1287 -1261
- package/dist/container/ContainerPlugin.d.ts +1 -1
- package/dist/container/ModuleFederationRuntimePlugin.d.ts +1 -1
- package/dist/exports.d.ts +1 -0
- package/dist/index.js +1351 -1303
- package/dist/util/hash/wasm-hash.d.ts +1 -1
- package/dist/util/identifier.d.ts +0 -36
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -148,15 +148,15 @@ var require_CachedInputFileSystem = __commonJS({
|
|
|
148
148
|
"../../node_modules/.pnpm/enhanced-resolve@5.17.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 = (path11) => {
|
|
152
|
+
let idx = path11.length - 1;
|
|
153
153
|
while (idx >= 0) {
|
|
154
|
-
const c =
|
|
154
|
+
const c = path11.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 path11.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
|
+
(path11, 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 path11 !== "string" && !Buffer.isBuffer(path11) && !(path11 instanceof URL) && typeof path11 !== "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
|
+
path11,
|
|
214
214
|
options,
|
|
215
215
|
callback
|
|
216
216
|
)
|
|
217
217
|
);
|
|
218
218
|
}
|
|
219
|
-
let callbacks = this._activeAsyncOperations.get(
|
|
219
|
+
let callbacks = this._activeAsyncOperations.get(path11);
|
|
220
220
|
if (callbacks) {
|
|
221
221
|
callbacks.push(callback);
|
|
222
222
|
return;
|
|
223
223
|
}
|
|
224
|
-
this._activeAsyncOperations.set(
|
|
224
|
+
this._activeAsyncOperations.set(path11, callbacks = [callback]);
|
|
225
225
|
provider(
|
|
226
|
-
|
|
226
|
+
path11,
|
|
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(path11);
|
|
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
|
+
(path11, options) => {
|
|
245
245
|
return (
|
|
246
246
|
/** @type {Function} */
|
|
247
247
|
this._syncProvider.call(
|
|
248
248
|
this._providerContext,
|
|
249
|
-
|
|
249
|
+
path11,
|
|
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(path11, 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 path11 !== "string" && !Buffer.isBuffer(path11) && !(path11 instanceof URL) && typeof path11 !== "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 path11 !== "string" ? path11.toString() : path11;
|
|
305
305
|
if (options) {
|
|
306
306
|
return (
|
|
307
307
|
/** @type {Function} */
|
|
308
308
|
this._provider.call(
|
|
309
309
|
this._providerContext,
|
|
310
|
-
|
|
310
|
+
path11,
|
|
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
|
+
path11,
|
|
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(path11, options) {
|
|
356
|
+
if (typeof path11 !== "string" && !Buffer.isBuffer(path11) && !(path11 instanceof URL) && typeof path11 !== "number") {
|
|
357
357
|
throw new TypeError("path must be a string");
|
|
358
358
|
}
|
|
359
|
-
const strPath = typeof
|
|
359
|
+
const strPath = typeof path11 !== "string" ? path11.toString() : path11;
|
|
360
360
|
if (options) {
|
|
361
361
|
return (
|
|
362
362
|
/** @type {Function} */
|
|
363
363
|
this._syncProvider.call(
|
|
364
364
|
this._providerContext,
|
|
365
|
-
|
|
365
|
+
path11,
|
|
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
|
+
path11
|
|
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(path11, err, result2) {
|
|
475
|
+
if (this._data.has(path11)) return;
|
|
476
476
|
const level = this._levels[this._currentLevel];
|
|
477
|
-
this._data.set(
|
|
478
|
-
level.add(
|
|
477
|
+
this._data.set(path11, { err, result: result2, level });
|
|
478
|
+
level.add(path11);
|
|
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
|
+
((path11, callback) => {
|
|
614
|
+
this.readFile(path11, (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
|
+
((path11) => {
|
|
636
|
+
const buffer = this.readFileSync(path11);
|
|
637
637
|
const data = JSON.parse(buffer.toString("utf-8"));
|
|
638
638
|
return data;
|
|
639
639
|
}),
|
|
@@ -727,6 +727,7 @@ __export(src_exports, {
|
|
|
727
727
|
SwcJsMinimizerRspackPlugin: () => SwcJsMinimizerRspackPlugin,
|
|
728
728
|
Template: () => Template,
|
|
729
729
|
ValidationError: () => ValidationError2,
|
|
730
|
+
WarnCaseSensitiveModulesPlugin: () => WarnCaseSensitiveModulesPlugin,
|
|
730
731
|
WebpackError: () => WebpackError2,
|
|
731
732
|
WebpackOptionsApply: () => RspackOptionsApply,
|
|
732
733
|
config: () => config,
|
|
@@ -791,6 +792,7 @@ __export(exports_exports, {
|
|
|
791
792
|
SwcJsMinimizerRspackPlugin: () => SwcJsMinimizerRspackPlugin,
|
|
792
793
|
Template: () => Template,
|
|
793
794
|
ValidationError: () => ValidationError2,
|
|
795
|
+
WarnCaseSensitiveModulesPlugin: () => WarnCaseSensitiveModulesPlugin,
|
|
794
796
|
WebpackError: () => WebpackError2,
|
|
795
797
|
WebpackOptionsApply: () => RspackOptionsApply,
|
|
796
798
|
config: () => config,
|
|
@@ -813,281 +815,11 @@ __export(exports_exports, {
|
|
|
813
815
|
var import_package = require("../package.json");
|
|
814
816
|
|
|
815
817
|
// src/Compilation.ts
|
|
816
|
-
var import_binding6 = require("@rspack/binding");
|
|
817
|
-
var liteTapable = __toESM(require("@rspack/lite-tapable"));
|
|
818
|
-
|
|
819
|
-
// src/Chunk.ts
|
|
820
818
|
var import_binding2 = require("@rspack/binding");
|
|
821
|
-
|
|
822
|
-
// src/ChunkGroup.ts
|
|
823
|
-
var import_binding = require("@rspack/binding");
|
|
824
|
-
var ChunkGroup = class _ChunkGroup {
|
|
825
|
-
#inner;
|
|
826
|
-
#innerCompilation;
|
|
827
|
-
static __from_binding(chunk, compilation) {
|
|
828
|
-
return new _ChunkGroup(chunk, compilation);
|
|
829
|
-
}
|
|
830
|
-
constructor(inner, compilation) {
|
|
831
|
-
this.#inner = inner;
|
|
832
|
-
this.#innerCompilation = compilation;
|
|
833
|
-
}
|
|
834
|
-
getFiles() {
|
|
835
|
-
const files = /* @__PURE__ */ new Set();
|
|
836
|
-
for (const chunk of this.#inner.chunks) {
|
|
837
|
-
for (const file of chunk.files) {
|
|
838
|
-
files.add(file);
|
|
839
|
-
}
|
|
840
|
-
}
|
|
841
|
-
return Array.from(files);
|
|
842
|
-
}
|
|
843
|
-
getParents() {
|
|
844
|
-
return this.#inner.__inner_parents.map((parent) => {
|
|
845
|
-
const cg = (0, import_binding.__chunk_group_inner_get_chunk_group)(
|
|
846
|
-
parent,
|
|
847
|
-
this.#innerCompilation
|
|
848
|
-
);
|
|
849
|
-
return _ChunkGroup.__from_binding(cg, this.#innerCompilation);
|
|
850
|
-
});
|
|
851
|
-
}
|
|
852
|
-
isInitial() {
|
|
853
|
-
return this.#inner.isInitial;
|
|
854
|
-
}
|
|
855
|
-
get chunks() {
|
|
856
|
-
return this.#inner.chunks.map(
|
|
857
|
-
(c) => Chunk.__from_binding(c, this.#innerCompilation)
|
|
858
|
-
);
|
|
859
|
-
}
|
|
860
|
-
get index() {
|
|
861
|
-
return this.#inner.index;
|
|
862
|
-
}
|
|
863
|
-
get name() {
|
|
864
|
-
return this.#inner.name;
|
|
865
|
-
}
|
|
866
|
-
get origins() {
|
|
867
|
-
return this.#inner.origins;
|
|
868
|
-
}
|
|
869
|
-
/**
|
|
870
|
-
* Note: This is not a webpack public API, maybe removed in future.
|
|
871
|
-
*
|
|
872
|
-
* @internal
|
|
873
|
-
*/
|
|
874
|
-
__internal__innerUkey() {
|
|
875
|
-
return this.#inner.__inner_ukey;
|
|
876
|
-
}
|
|
877
|
-
/**
|
|
878
|
-
* Note: This is not a webpack public API, maybe removed in future.
|
|
879
|
-
*
|
|
880
|
-
* @internal
|
|
881
|
-
*/
|
|
882
|
-
__internal__innerCompilation() {
|
|
883
|
-
return this.#innerCompilation;
|
|
884
|
-
}
|
|
885
|
-
};
|
|
886
|
-
|
|
887
|
-
// src/util/comparators.ts
|
|
888
|
-
var TwoKeyWeakMap = class {
|
|
889
|
-
constructor() {
|
|
890
|
-
this._map = /* @__PURE__ */ new WeakMap();
|
|
891
|
-
}
|
|
892
|
-
get(key1, key2) {
|
|
893
|
-
const childMap = this._map.get(key1);
|
|
894
|
-
if (childMap === void 0) {
|
|
895
|
-
return void 0;
|
|
896
|
-
}
|
|
897
|
-
return childMap.get(key2);
|
|
898
|
-
}
|
|
899
|
-
set(key1, key2, value) {
|
|
900
|
-
let childMap = this._map.get(key1);
|
|
901
|
-
if (childMap === void 0) {
|
|
902
|
-
childMap = /* @__PURE__ */ new WeakMap();
|
|
903
|
-
this._map.set(key1, childMap);
|
|
904
|
-
}
|
|
905
|
-
childMap.set(key2, value);
|
|
906
|
-
}
|
|
907
|
-
};
|
|
908
|
-
var concatComparatorsCache = new TwoKeyWeakMap();
|
|
909
|
-
var concatComparators = (...comps) => {
|
|
910
|
-
const [c1, c2, ...cRest] = comps;
|
|
911
|
-
if (c2 === void 0) {
|
|
912
|
-
return c1;
|
|
913
|
-
}
|
|
914
|
-
if (cRest.length > 0) {
|
|
915
|
-
const [c3, ...cRest2] = cRest;
|
|
916
|
-
return concatComparators(c1, concatComparators(c2, c3, ...cRest2));
|
|
917
|
-
}
|
|
918
|
-
const cacheEntry = concatComparatorsCache.get(c1, c2);
|
|
919
|
-
if (cacheEntry !== void 0) return cacheEntry;
|
|
920
|
-
const result2 = (a, b) => {
|
|
921
|
-
const res = c1(a, b);
|
|
922
|
-
if (res !== 0) return res;
|
|
923
|
-
return c2(a, b);
|
|
924
|
-
};
|
|
925
|
-
concatComparatorsCache.set(c1, c2, result2);
|
|
926
|
-
return result2;
|
|
927
|
-
};
|
|
928
|
-
var compareIds = (a, b) => {
|
|
929
|
-
if (typeof a !== typeof b) {
|
|
930
|
-
return typeof a < typeof b ? -1 : 1;
|
|
931
|
-
}
|
|
932
|
-
if (a < b) return -1;
|
|
933
|
-
if (a > b) return 1;
|
|
934
|
-
return 0;
|
|
935
|
-
};
|
|
936
|
-
var compareChunkGroupsByIndex = (a, b) => {
|
|
937
|
-
return a.index < b.index ? -1 : 1;
|
|
938
|
-
};
|
|
939
|
-
var compareSelectCache = new TwoKeyWeakMap();
|
|
940
|
-
var compareSelect = (getter2, comparator) => {
|
|
941
|
-
const cacheEntry = compareSelectCache.get(getter2, comparator);
|
|
942
|
-
if (cacheEntry !== void 0) return cacheEntry;
|
|
943
|
-
const result2 = (a, b) => {
|
|
944
|
-
const aValue = getter2(a);
|
|
945
|
-
const bValue = getter2(b);
|
|
946
|
-
if (aValue !== void 0 && aValue !== null) {
|
|
947
|
-
if (bValue !== void 0 && bValue !== null) {
|
|
948
|
-
return comparator(aValue, bValue);
|
|
949
|
-
}
|
|
950
|
-
return -1;
|
|
951
|
-
}
|
|
952
|
-
if (bValue !== void 0 && bValue !== null) {
|
|
953
|
-
return 1;
|
|
954
|
-
}
|
|
955
|
-
return 0;
|
|
956
|
-
};
|
|
957
|
-
compareSelectCache.set(getter2, comparator, result2);
|
|
958
|
-
return result2;
|
|
959
|
-
};
|
|
960
|
-
var compareNumbers = (a, b) => {
|
|
961
|
-
if (typeof a !== typeof b) {
|
|
962
|
-
return typeof a < typeof b ? -1 : 1;
|
|
963
|
-
}
|
|
964
|
-
if (a < b) return -1;
|
|
965
|
-
if (a > b) return 1;
|
|
966
|
-
return 0;
|
|
967
|
-
};
|
|
968
|
-
|
|
969
|
-
// src/Chunk.ts
|
|
970
|
-
var Chunk = class _Chunk {
|
|
971
|
-
#inner;
|
|
972
|
-
#innerCompilation;
|
|
973
|
-
static __from_binding(chunk, compilation) {
|
|
974
|
-
if (compilation instanceof Compilation) {
|
|
975
|
-
return new _Chunk(chunk, compilation.__internal_getInner());
|
|
976
|
-
}
|
|
977
|
-
return new _Chunk(chunk, compilation);
|
|
978
|
-
}
|
|
979
|
-
constructor(chunk, compilation) {
|
|
980
|
-
this.#inner = chunk;
|
|
981
|
-
this.#innerCompilation = compilation;
|
|
982
|
-
this.name = chunk.name;
|
|
983
|
-
this.id = chunk.id;
|
|
984
|
-
this.ids = chunk.ids;
|
|
985
|
-
this.idNameHints = chunk.idNameHints;
|
|
986
|
-
this.filenameTemplate = chunk.filenameTemplate;
|
|
987
|
-
this.cssFilenameTemplate = chunk.cssFilenameTemplate;
|
|
988
|
-
this.files = new Set(chunk.files);
|
|
989
|
-
this.runtime = new Set(chunk.runtime);
|
|
990
|
-
this.hash = chunk.hash;
|
|
991
|
-
this.contentHash = chunk.contentHash;
|
|
992
|
-
this.renderedHash = chunk.renderedHash;
|
|
993
|
-
this.chunkReason = chunk.chunkReason;
|
|
994
|
-
this.auxiliaryFiles = new Set(chunk.auxiliaryFiles);
|
|
995
|
-
}
|
|
996
|
-
isOnlyInitial() {
|
|
997
|
-
return (0, import_binding2.__chunk_inner_is_only_initial)(
|
|
998
|
-
this.#inner.__inner_ukey,
|
|
999
|
-
this.#innerCompilation
|
|
1000
|
-
);
|
|
1001
|
-
}
|
|
1002
|
-
canBeInitial() {
|
|
1003
|
-
return (0, import_binding2.__chunk_inner_can_be_initial)(
|
|
1004
|
-
this.#inner.__inner_ukey,
|
|
1005
|
-
this.#innerCompilation
|
|
1006
|
-
);
|
|
1007
|
-
}
|
|
1008
|
-
hasRuntime() {
|
|
1009
|
-
return (0, import_binding2.__chunk_inner_has_runtime)(
|
|
1010
|
-
this.#inner.__inner_ukey,
|
|
1011
|
-
this.#innerCompilation
|
|
1012
|
-
);
|
|
1013
|
-
}
|
|
1014
|
-
get groupsIterable() {
|
|
1015
|
-
const chunk_groups = this.#inner.__inner_groups.map((ukey) => {
|
|
1016
|
-
const cg = (0, import_binding2.__chunk_group_inner_get_chunk_group)(
|
|
1017
|
-
ukey,
|
|
1018
|
-
this.#innerCompilation
|
|
1019
|
-
);
|
|
1020
|
-
return ChunkGroup.__from_binding(cg, this.#innerCompilation);
|
|
1021
|
-
});
|
|
1022
|
-
chunk_groups.sort(compareChunkGroupsByIndex);
|
|
1023
|
-
return new Set(chunk_groups);
|
|
1024
|
-
}
|
|
1025
|
-
getChunkMaps(realHash) {
|
|
1026
|
-
const chunkHashMap = {};
|
|
1027
|
-
const chunkContentHashMap = {};
|
|
1028
|
-
const chunkNameMap = {};
|
|
1029
|
-
for (const chunk of this.getAllAsyncChunks()) {
|
|
1030
|
-
const id = chunk.id;
|
|
1031
|
-
if (!id) continue;
|
|
1032
|
-
const chunkHash = realHash ? chunk.hash : chunk.renderedHash;
|
|
1033
|
-
if (chunkHash) {
|
|
1034
|
-
chunkHashMap[id] = chunkHash;
|
|
1035
|
-
}
|
|
1036
|
-
for (const key of Object.keys(chunk.contentHash)) {
|
|
1037
|
-
if (!chunkContentHashMap[key]) {
|
|
1038
|
-
chunkContentHashMap[key] = {};
|
|
1039
|
-
}
|
|
1040
|
-
chunkContentHashMap[key][id] = chunk.contentHash[key];
|
|
1041
|
-
}
|
|
1042
|
-
if (chunk.name) {
|
|
1043
|
-
chunkNameMap[id] = chunk.name;
|
|
1044
|
-
}
|
|
1045
|
-
}
|
|
1046
|
-
return {
|
|
1047
|
-
hash: chunkHashMap,
|
|
1048
|
-
contentHash: chunkContentHashMap,
|
|
1049
|
-
name: chunkNameMap
|
|
1050
|
-
};
|
|
1051
|
-
}
|
|
1052
|
-
getAllAsyncChunks() {
|
|
1053
|
-
return new Set(
|
|
1054
|
-
(0, import_binding2.__chunk_inner_get_all_async_chunks)(
|
|
1055
|
-
this.#inner.__inner_ukey,
|
|
1056
|
-
this.#innerCompilation
|
|
1057
|
-
).map((c) => _Chunk.__from_binding(c, this.#innerCompilation))
|
|
1058
|
-
);
|
|
1059
|
-
}
|
|
1060
|
-
getAllInitialChunks() {
|
|
1061
|
-
return new Set(
|
|
1062
|
-
(0, import_binding2.__chunk_inner_get_all_initial_chunks)(
|
|
1063
|
-
this.#inner.__inner_ukey,
|
|
1064
|
-
this.#innerCompilation
|
|
1065
|
-
).map((c) => _Chunk.__from_binding(c, this.#innerCompilation))
|
|
1066
|
-
);
|
|
1067
|
-
}
|
|
1068
|
-
getAllReferencedChunks() {
|
|
1069
|
-
return new Set(
|
|
1070
|
-
(0, import_binding2.__chunk_inner_get_all_referenced_chunks)(
|
|
1071
|
-
this.#inner.__inner_ukey,
|
|
1072
|
-
this.#innerCompilation
|
|
1073
|
-
).map((c) => _Chunk.__from_binding(c, this.#innerCompilation))
|
|
1074
|
-
);
|
|
1075
|
-
}
|
|
1076
|
-
/**
|
|
1077
|
-
* Note: This is not a webpack public API, maybe removed in future.
|
|
1078
|
-
*
|
|
1079
|
-
* @internal
|
|
1080
|
-
*/
|
|
1081
|
-
__internal__innerUkey() {
|
|
1082
|
-
return this.#inner.__inner_ukey;
|
|
1083
|
-
}
|
|
1084
|
-
};
|
|
1085
|
-
|
|
1086
|
-
// src/ChunkGraph.ts
|
|
1087
|
-
var import_binding4 = require("@rspack/binding");
|
|
819
|
+
var liteTapable = __toESM(require("@rspack/lite-tapable"));
|
|
1088
820
|
|
|
1089
821
|
// src/Module.ts
|
|
1090
|
-
var
|
|
822
|
+
var import_binding = require("@rspack/binding");
|
|
1091
823
|
|
|
1092
824
|
// src/Dependency.ts
|
|
1093
825
|
var Dependency = class _Dependency {
|
|
@@ -1164,7 +896,7 @@ var DependenciesBlock = class _DependenciesBlock {
|
|
|
1164
896
|
var import_webpack_sources = require("../compiled/webpack-sources/index.js");
|
|
1165
897
|
var JsSource = class extends import_webpack_sources.Source {
|
|
1166
898
|
static __from_binding(source) {
|
|
1167
|
-
if (source.source
|
|
899
|
+
if (Buffer.isBuffer(source.source)) {
|
|
1168
900
|
return new import_webpack_sources.RawSource(source.source);
|
|
1169
901
|
}
|
|
1170
902
|
if (!source.map) {
|
|
@@ -1393,7 +1125,7 @@ var Module = class _Module {
|
|
|
1393
1125
|
modules: {
|
|
1394
1126
|
enumerable: true,
|
|
1395
1127
|
get() {
|
|
1396
|
-
if (module2 instanceof
|
|
1128
|
+
if (module2 instanceof import_binding.JsModule) {
|
|
1397
1129
|
return module2.modules ? module2.modules.map((m) => _Module.__from_binding(m)) : void 0;
|
|
1398
1130
|
}
|
|
1399
1131
|
return void 0;
|
|
@@ -1456,89 +1188,298 @@ var Module = class _Module {
|
|
|
1456
1188
|
if (typeof this.#inner.nameForCondition === "string") {
|
|
1457
1189
|
return this.#inner.nameForCondition;
|
|
1458
1190
|
}
|
|
1459
|
-
return null;
|
|
1191
|
+
return null;
|
|
1192
|
+
}
|
|
1193
|
+
size(type) {
|
|
1194
|
+
if ("size" in this.#inner) {
|
|
1195
|
+
return this.#inner.size(type);
|
|
1196
|
+
}
|
|
1197
|
+
return 0;
|
|
1198
|
+
}
|
|
1199
|
+
};
|
|
1200
|
+
var CodeGenerationResult = class {
|
|
1201
|
+
#inner;
|
|
1202
|
+
constructor(result2) {
|
|
1203
|
+
this.#inner = result2;
|
|
1204
|
+
}
|
|
1205
|
+
get(sourceType) {
|
|
1206
|
+
return this.#inner.sources[sourceType];
|
|
1207
|
+
}
|
|
1208
|
+
};
|
|
1209
|
+
|
|
1210
|
+
// src/ChunkGroup.ts
|
|
1211
|
+
var CHUNK_GROUP_MAPPINGS = /* @__PURE__ */ new WeakMap();
|
|
1212
|
+
var ChunkGroup = class _ChunkGroup {
|
|
1213
|
+
#inner;
|
|
1214
|
+
static __from_binding(binding3) {
|
|
1215
|
+
let chunkGroup = CHUNK_GROUP_MAPPINGS.get(binding3);
|
|
1216
|
+
if (chunkGroup) {
|
|
1217
|
+
return chunkGroup;
|
|
1218
|
+
}
|
|
1219
|
+
chunkGroup = new _ChunkGroup(binding3);
|
|
1220
|
+
CHUNK_GROUP_MAPPINGS.set(binding3, chunkGroup);
|
|
1221
|
+
return chunkGroup;
|
|
1222
|
+
}
|
|
1223
|
+
constructor(inner) {
|
|
1224
|
+
this.#inner = inner;
|
|
1225
|
+
Object.defineProperties(this, {
|
|
1226
|
+
chunks: {
|
|
1227
|
+
enumerable: true,
|
|
1228
|
+
get: () => {
|
|
1229
|
+
return this.#inner.chunks.map(
|
|
1230
|
+
(binding3) => Chunk.__from_binding(binding3)
|
|
1231
|
+
);
|
|
1232
|
+
}
|
|
1233
|
+
},
|
|
1234
|
+
index: {
|
|
1235
|
+
enumerable: true,
|
|
1236
|
+
get: () => {
|
|
1237
|
+
return this.#inner.index;
|
|
1238
|
+
}
|
|
1239
|
+
},
|
|
1240
|
+
name: {
|
|
1241
|
+
enumerable: true,
|
|
1242
|
+
get: () => {
|
|
1243
|
+
return this.#inner.name;
|
|
1244
|
+
}
|
|
1245
|
+
},
|
|
1246
|
+
origins: {
|
|
1247
|
+
enumerable: true,
|
|
1248
|
+
get: () => {
|
|
1249
|
+
return this.#inner.origins.map((origin) => ({
|
|
1250
|
+
module: origin.module ? Module.__from_binding(origin.module) : void 0,
|
|
1251
|
+
request: origin.request
|
|
1252
|
+
}));
|
|
1253
|
+
}
|
|
1254
|
+
}
|
|
1255
|
+
});
|
|
1256
|
+
}
|
|
1257
|
+
getFiles() {
|
|
1258
|
+
return this.#inner.getFiles();
|
|
1259
|
+
}
|
|
1260
|
+
getParents() {
|
|
1261
|
+
return this.#inner.getParents().map((binding3) => _ChunkGroup.__from_binding(binding3));
|
|
1262
|
+
}
|
|
1263
|
+
isInitial() {
|
|
1264
|
+
return this.#inner.isInitial();
|
|
1265
|
+
}
|
|
1266
|
+
};
|
|
1267
|
+
|
|
1268
|
+
// src/Chunk.ts
|
|
1269
|
+
var CHUNK_MAPPINGS = /* @__PURE__ */ new WeakMap();
|
|
1270
|
+
var Chunk = class _Chunk {
|
|
1271
|
+
#inner;
|
|
1272
|
+
static __from_binding(binding3) {
|
|
1273
|
+
let chunk = CHUNK_MAPPINGS.get(binding3);
|
|
1274
|
+
if (chunk) {
|
|
1275
|
+
return chunk;
|
|
1276
|
+
}
|
|
1277
|
+
chunk = new _Chunk(binding3);
|
|
1278
|
+
CHUNK_MAPPINGS.set(binding3, chunk);
|
|
1279
|
+
return chunk;
|
|
1280
|
+
}
|
|
1281
|
+
static __to_binding(chunk) {
|
|
1282
|
+
return chunk.#inner;
|
|
1283
|
+
}
|
|
1284
|
+
constructor(binding3) {
|
|
1285
|
+
this.#inner = binding3;
|
|
1286
|
+
Object.defineProperties(this, {
|
|
1287
|
+
name: {
|
|
1288
|
+
enumerable: true,
|
|
1289
|
+
get: () => {
|
|
1290
|
+
return binding3.name;
|
|
1291
|
+
}
|
|
1292
|
+
},
|
|
1293
|
+
id: {
|
|
1294
|
+
enumerable: true,
|
|
1295
|
+
get: () => {
|
|
1296
|
+
return binding3.id;
|
|
1297
|
+
}
|
|
1298
|
+
},
|
|
1299
|
+
ids: {
|
|
1300
|
+
enumerable: true,
|
|
1301
|
+
get: () => {
|
|
1302
|
+
return binding3.ids;
|
|
1303
|
+
}
|
|
1304
|
+
},
|
|
1305
|
+
idNameHints: {
|
|
1306
|
+
enumerable: true,
|
|
1307
|
+
get: () => {
|
|
1308
|
+
return binding3.idNameHints;
|
|
1309
|
+
}
|
|
1310
|
+
},
|
|
1311
|
+
filenameTemplate: {
|
|
1312
|
+
enumerable: true,
|
|
1313
|
+
get: () => {
|
|
1314
|
+
return binding3.filenameTemplate;
|
|
1315
|
+
}
|
|
1316
|
+
},
|
|
1317
|
+
cssFilenameTemplate: {
|
|
1318
|
+
enumerable: true,
|
|
1319
|
+
get: () => {
|
|
1320
|
+
return binding3.cssFilenameTemplate;
|
|
1321
|
+
}
|
|
1322
|
+
},
|
|
1323
|
+
files: {
|
|
1324
|
+
enumerable: true,
|
|
1325
|
+
get: () => {
|
|
1326
|
+
return new Set(binding3.files);
|
|
1327
|
+
}
|
|
1328
|
+
},
|
|
1329
|
+
runtime: {
|
|
1330
|
+
enumerable: true,
|
|
1331
|
+
get: () => {
|
|
1332
|
+
return new Set(binding3.runtime);
|
|
1333
|
+
}
|
|
1334
|
+
},
|
|
1335
|
+
hash: {
|
|
1336
|
+
enumerable: true,
|
|
1337
|
+
get: () => {
|
|
1338
|
+
return binding3.hash;
|
|
1339
|
+
}
|
|
1340
|
+
},
|
|
1341
|
+
contentHash: {
|
|
1342
|
+
enumerable: true,
|
|
1343
|
+
get: () => {
|
|
1344
|
+
return binding3.contentHash;
|
|
1345
|
+
}
|
|
1346
|
+
},
|
|
1347
|
+
renderedHash: {
|
|
1348
|
+
enumerable: true,
|
|
1349
|
+
get: () => {
|
|
1350
|
+
return binding3.renderedHash;
|
|
1351
|
+
}
|
|
1352
|
+
},
|
|
1353
|
+
chunkReason: {
|
|
1354
|
+
enumerable: true,
|
|
1355
|
+
get: () => {
|
|
1356
|
+
return binding3.chunkReason;
|
|
1357
|
+
}
|
|
1358
|
+
},
|
|
1359
|
+
auxiliaryFiles: {
|
|
1360
|
+
enumerable: true,
|
|
1361
|
+
get: () => {
|
|
1362
|
+
return new Set(binding3.auxiliaryFiles);
|
|
1363
|
+
}
|
|
1364
|
+
}
|
|
1365
|
+
});
|
|
1366
|
+
}
|
|
1367
|
+
isOnlyInitial() {
|
|
1368
|
+
return this.#inner.isOnlyInitial();
|
|
1369
|
+
}
|
|
1370
|
+
canBeInitial() {
|
|
1371
|
+
return this.#inner.canBeInitial();
|
|
1372
|
+
}
|
|
1373
|
+
hasRuntime() {
|
|
1374
|
+
return this.#inner.hasRuntime();
|
|
1375
|
+
}
|
|
1376
|
+
get groupsIterable() {
|
|
1377
|
+
return new Set(
|
|
1378
|
+
this.#inner.groups().map((binding3) => ChunkGroup.__from_binding(binding3))
|
|
1379
|
+
);
|
|
1380
|
+
}
|
|
1381
|
+
getChunkMaps(realHash) {
|
|
1382
|
+
const chunkHashMap = {};
|
|
1383
|
+
const chunkContentHashMap = {};
|
|
1384
|
+
const chunkNameMap = {};
|
|
1385
|
+
for (const chunk of this.getAllAsyncChunks()) {
|
|
1386
|
+
const id = chunk.id;
|
|
1387
|
+
if (!id) continue;
|
|
1388
|
+
const chunkHash = realHash ? chunk.hash : chunk.renderedHash;
|
|
1389
|
+
if (chunkHash) {
|
|
1390
|
+
chunkHashMap[id] = chunkHash;
|
|
1391
|
+
}
|
|
1392
|
+
for (const key of Object.keys(chunk.contentHash)) {
|
|
1393
|
+
if (!chunkContentHashMap[key]) {
|
|
1394
|
+
chunkContentHashMap[key] = {};
|
|
1395
|
+
}
|
|
1396
|
+
chunkContentHashMap[key][id] = chunk.contentHash[key];
|
|
1397
|
+
}
|
|
1398
|
+
if (chunk.name) {
|
|
1399
|
+
chunkNameMap[id] = chunk.name;
|
|
1400
|
+
}
|
|
1401
|
+
}
|
|
1402
|
+
return {
|
|
1403
|
+
hash: chunkHashMap,
|
|
1404
|
+
contentHash: chunkContentHashMap,
|
|
1405
|
+
name: chunkNameMap
|
|
1406
|
+
};
|
|
1460
1407
|
}
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
return 0;
|
|
1408
|
+
getAllAsyncChunks() {
|
|
1409
|
+
return new Set(
|
|
1410
|
+
this.#inner.getAllAsyncChunks().map((binding3) => _Chunk.__from_binding(binding3))
|
|
1411
|
+
);
|
|
1466
1412
|
}
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
this.#inner = result2;
|
|
1413
|
+
getAllInitialChunks() {
|
|
1414
|
+
return new Set(
|
|
1415
|
+
this.#inner.getAllInitialChunks().map((binding3) => _Chunk.__from_binding(binding3))
|
|
1416
|
+
);
|
|
1472
1417
|
}
|
|
1473
|
-
|
|
1474
|
-
return
|
|
1418
|
+
getAllReferencedChunks() {
|
|
1419
|
+
return new Set(
|
|
1420
|
+
this.#inner.getAllReferencedChunks().map((binding3) => _Chunk.__from_binding(binding3))
|
|
1421
|
+
);
|
|
1475
1422
|
}
|
|
1476
1423
|
};
|
|
1477
1424
|
|
|
1478
1425
|
// src/ChunkGraph.ts
|
|
1479
|
-
var ChunkGraph = class {
|
|
1480
|
-
|
|
1481
|
-
|
|
1426
|
+
var ChunkGraph = class _ChunkGraph {
|
|
1427
|
+
#inner;
|
|
1428
|
+
static __from_binding(binding3) {
|
|
1429
|
+
return new _ChunkGraph(binding3);
|
|
1430
|
+
}
|
|
1431
|
+
constructor(binding3) {
|
|
1432
|
+
this.#inner = binding3;
|
|
1482
1433
|
}
|
|
1483
1434
|
getChunkModules(chunk) {
|
|
1484
|
-
return (
|
|
1485
|
-
chunk.__internal__innerUkey(),
|
|
1486
|
-
this.compilation.__internal_getInner()
|
|
1487
|
-
).map((m) => Module.__from_binding(m, this.compilation));
|
|
1435
|
+
return this.#inner.getChunkModules(Chunk.__to_binding(chunk)).map((binding3) => Module.__from_binding(binding3));
|
|
1488
1436
|
}
|
|
1489
1437
|
getChunkModulesIterable(chunk) {
|
|
1490
|
-
return
|
|
1491
|
-
(0, import_binding4.__chunk_graph_inner_get_chunk_modules)(
|
|
1492
|
-
chunk.__internal__innerUkey(),
|
|
1493
|
-
this.compilation.__internal_getInner()
|
|
1494
|
-
).map((m) => Module.__from_binding(m, this.compilation))
|
|
1495
|
-
);
|
|
1438
|
+
return this.#inner.getChunkModules(Chunk.__to_binding(chunk)).map((binding3) => Module.__from_binding(binding3));
|
|
1496
1439
|
}
|
|
1497
1440
|
getChunkEntryModulesIterable(chunk) {
|
|
1498
|
-
return
|
|
1499
|
-
(0, import_binding4.__chunk_graph_inner_get_chunk_entry_modules)(
|
|
1500
|
-
chunk.__internal__innerUkey(),
|
|
1501
|
-
this.compilation.__internal_getInner()
|
|
1502
|
-
).map((m) => Module.__from_binding(m, this.compilation))
|
|
1503
|
-
);
|
|
1441
|
+
return this.#inner.getChunkEntryModules(Chunk.__to_binding(chunk)).map((binding3) => Module.__from_binding(binding3));
|
|
1504
1442
|
}
|
|
1505
1443
|
getChunkEntryDependentChunksIterable(chunk) {
|
|
1506
|
-
return
|
|
1507
|
-
(0, import_binding4.__chunk_graph_inner_get_chunk_entry_dependent_chunks_iterable)(
|
|
1508
|
-
chunk.__internal__innerUkey(),
|
|
1509
|
-
this.compilation.__internal_getInner()
|
|
1510
|
-
).map(
|
|
1511
|
-
(c) => Chunk.__from_binding(c, this.compilation.__internal_getInner())
|
|
1512
|
-
)
|
|
1513
|
-
);
|
|
1444
|
+
return this.#inner.getChunkEntryDependentChunksIterable(Chunk.__to_binding(chunk)).map((binding3) => Chunk.__from_binding(binding3));
|
|
1514
1445
|
}
|
|
1515
1446
|
getChunkModulesIterableBySourceType(chunk, sourceType) {
|
|
1516
|
-
return
|
|
1517
|
-
(
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
);
|
|
1447
|
+
return this.#inner.getChunkModulesIterableBySourceType(
|
|
1448
|
+
Chunk.__to_binding(chunk),
|
|
1449
|
+
sourceType
|
|
1450
|
+
).map((binding3) => Module.__from_binding(binding3));
|
|
1451
|
+
}
|
|
1452
|
+
getModuleChunks(module2) {
|
|
1453
|
+
return this.#inner.getModuleChunks(Module.__to_binding(module2)).map((binding3) => Chunk.__from_binding(binding3));
|
|
1454
|
+
}
|
|
1455
|
+
getModuleChunksIterable(module2) {
|
|
1456
|
+
return this.#inner.getModuleChunks(Module.__to_binding(module2)).map((binding3) => Chunk.__from_binding(binding3));
|
|
1457
|
+
}
|
|
1458
|
+
getModuleId(module2) {
|
|
1459
|
+
return this.#inner.getModuleId(Module.__to_binding(module2));
|
|
1523
1460
|
}
|
|
1524
1461
|
};
|
|
1525
1462
|
|
|
1526
1463
|
// src/Entrypoint.ts
|
|
1527
|
-
var
|
|
1464
|
+
var ENTRYPOINT_MAPPINGS = /* @__PURE__ */ new WeakMap();
|
|
1528
1465
|
var Entrypoint = class _Entrypoint extends ChunkGroup {
|
|
1529
|
-
|
|
1530
|
-
|
|
1466
|
+
#inner;
|
|
1467
|
+
static __from_binding(binding3) {
|
|
1468
|
+
let entrypoint = ENTRYPOINT_MAPPINGS.get(binding3);
|
|
1469
|
+
if (entrypoint) {
|
|
1470
|
+
return entrypoint;
|
|
1471
|
+
}
|
|
1472
|
+
entrypoint = new _Entrypoint(binding3);
|
|
1473
|
+
ENTRYPOINT_MAPPINGS.set(binding3, entrypoint);
|
|
1474
|
+
return entrypoint;
|
|
1531
1475
|
}
|
|
1532
|
-
constructor(
|
|
1533
|
-
super(
|
|
1476
|
+
constructor(binding3) {
|
|
1477
|
+
super(binding3);
|
|
1478
|
+
this.#inner = binding3;
|
|
1534
1479
|
}
|
|
1535
1480
|
getRuntimeChunk() {
|
|
1536
|
-
const
|
|
1537
|
-
|
|
1538
|
-
this.__internal__innerCompilation()
|
|
1539
|
-
);
|
|
1540
|
-
if (c) return Chunk.__from_binding(c, this.__internal__innerCompilation());
|
|
1541
|
-
return null;
|
|
1481
|
+
const chunkBinding = this.#inner.getRuntimeChunk();
|
|
1482
|
+
return chunkBinding ? Chunk.__from_binding(chunkBinding) : null;
|
|
1542
1483
|
}
|
|
1543
1484
|
};
|
|
1544
1485
|
|
|
@@ -1555,6 +1496,64 @@ var cutOffByFlag = (stack, flag) => {
|
|
|
1555
1496
|
};
|
|
1556
1497
|
var cutOffLoaderExecution = (stack) => cutOffByFlag(stack, loaderFlag);
|
|
1557
1498
|
|
|
1499
|
+
// src/ExportsInfo.ts
|
|
1500
|
+
var ExportsInfo = class _ExportsInfo {
|
|
1501
|
+
#inner;
|
|
1502
|
+
static __from_binding(binding3) {
|
|
1503
|
+
return new _ExportsInfo(binding3);
|
|
1504
|
+
}
|
|
1505
|
+
constructor(binding3) {
|
|
1506
|
+
this.#inner = binding3;
|
|
1507
|
+
}
|
|
1508
|
+
isUsed(runtime) {
|
|
1509
|
+
return this.#inner.isUsed(runtime);
|
|
1510
|
+
}
|
|
1511
|
+
isModuleUsed(runtime) {
|
|
1512
|
+
return this.#inner.isModuleUsed(runtime);
|
|
1513
|
+
}
|
|
1514
|
+
setUsedInUnknownWay(runtime) {
|
|
1515
|
+
return this.#inner.setUsedInUnknownWay(runtime);
|
|
1516
|
+
}
|
|
1517
|
+
getUsed(name2, runtime) {
|
|
1518
|
+
return this.#inner.getUsed(name2, runtime);
|
|
1519
|
+
}
|
|
1520
|
+
};
|
|
1521
|
+
|
|
1522
|
+
// src/ModuleGraphConnection.ts
|
|
1523
|
+
var MODULE_GRAPH_CONNECTION_MAPPINGS = /* @__PURE__ */ new WeakMap();
|
|
1524
|
+
var ModuleGraphConnection = class _ModuleGraphConnection {
|
|
1525
|
+
#inner;
|
|
1526
|
+
static __from_binding(binding3) {
|
|
1527
|
+
let connection = MODULE_GRAPH_CONNECTION_MAPPINGS.get(binding3);
|
|
1528
|
+
if (connection) {
|
|
1529
|
+
return connection;
|
|
1530
|
+
}
|
|
1531
|
+
connection = new _ModuleGraphConnection(binding3);
|
|
1532
|
+
MODULE_GRAPH_CONNECTION_MAPPINGS.set(binding3, connection);
|
|
1533
|
+
return connection;
|
|
1534
|
+
}
|
|
1535
|
+
static __to_binding(data) {
|
|
1536
|
+
return data.#inner;
|
|
1537
|
+
}
|
|
1538
|
+
constructor(binding3) {
|
|
1539
|
+
this.#inner = binding3;
|
|
1540
|
+
Object.defineProperties(this, {
|
|
1541
|
+
module: {
|
|
1542
|
+
enumerable: true,
|
|
1543
|
+
get() {
|
|
1544
|
+
return binding3.module ? Module.__from_binding(binding3.module) : null;
|
|
1545
|
+
}
|
|
1546
|
+
},
|
|
1547
|
+
dependency: {
|
|
1548
|
+
enumerable: true,
|
|
1549
|
+
get() {
|
|
1550
|
+
return Dependency.__from_binding(binding3.dependency);
|
|
1551
|
+
}
|
|
1552
|
+
}
|
|
1553
|
+
});
|
|
1554
|
+
}
|
|
1555
|
+
};
|
|
1556
|
+
|
|
1558
1557
|
// src/ModuleGraph.ts
|
|
1559
1558
|
var ModuleGraph = class _ModuleGraph {
|
|
1560
1559
|
static __from_binding(binding3) {
|
|
@@ -1568,10 +1567,30 @@ var ModuleGraph = class _ModuleGraph {
|
|
|
1568
1567
|
const binding3 = this.#inner.getModule(Dependency.__to_binding(dependency));
|
|
1569
1568
|
return binding3 ? Module.__from_binding(binding3) : null;
|
|
1570
1569
|
}
|
|
1570
|
+
getResolvedModule(dependency) {
|
|
1571
|
+
const binding3 = this.#inner.getResolvedModule(
|
|
1572
|
+
Dependency.__to_binding(dependency)
|
|
1573
|
+
);
|
|
1574
|
+
return binding3 ? Module.__from_binding(binding3) : null;
|
|
1575
|
+
}
|
|
1571
1576
|
getIssuer(module2) {
|
|
1572
1577
|
const binding3 = this.#inner.getIssuer(Module.__to_binding(module2));
|
|
1573
1578
|
return binding3 ? Module.__from_binding(binding3) : null;
|
|
1574
1579
|
}
|
|
1580
|
+
getExportsInfo(module2) {
|
|
1581
|
+
return ExportsInfo.__from_binding(
|
|
1582
|
+
this.#inner.getExportsInfo(Module.__to_binding(module2))
|
|
1583
|
+
);
|
|
1584
|
+
}
|
|
1585
|
+
getConnection(dependency) {
|
|
1586
|
+
const binding3 = this.#inner.getConnection(
|
|
1587
|
+
Dependency.__to_binding(dependency)
|
|
1588
|
+
);
|
|
1589
|
+
return binding3 ? ModuleGraphConnection.__from_binding(binding3) : null;
|
|
1590
|
+
}
|
|
1591
|
+
getOutgoingConnections(module2) {
|
|
1592
|
+
return this.#inner.getOutgoingConnections(Module.__to_binding(module2)).map((binding3) => ModuleGraphConnection.__from_binding(binding3));
|
|
1593
|
+
}
|
|
1575
1594
|
};
|
|
1576
1595
|
|
|
1577
1596
|
// src/util/index.ts
|
|
@@ -1859,6 +1878,16 @@ function presetToOptions(name2) {
|
|
|
1859
1878
|
}
|
|
1860
1879
|
}
|
|
1861
1880
|
|
|
1881
|
+
// src/lib/WebpackError.ts
|
|
1882
|
+
var import_node_util = require("util");
|
|
1883
|
+
var WebpackError = class extends Error {
|
|
1884
|
+
[import_node_util.inspect.custom]() {
|
|
1885
|
+
return this.stack + (this.details ? `
|
|
1886
|
+
${this.details}` : "");
|
|
1887
|
+
}
|
|
1888
|
+
};
|
|
1889
|
+
var WebpackError_default = WebpackError;
|
|
1890
|
+
|
|
1862
1891
|
// src/logging/Logger.ts
|
|
1863
1892
|
var LogType = Object.freeze({
|
|
1864
1893
|
error: (
|
|
@@ -2054,6 +2083,85 @@ var Logger = class {
|
|
|
2054
2083
|
// src/stats/StatsFactory.ts
|
|
2055
2084
|
var import_lite_tapable = require("@rspack/lite-tapable");
|
|
2056
2085
|
|
|
2086
|
+
// src/util/comparators.ts
|
|
2087
|
+
var TwoKeyWeakMap = class {
|
|
2088
|
+
constructor() {
|
|
2089
|
+
this._map = /* @__PURE__ */ new WeakMap();
|
|
2090
|
+
}
|
|
2091
|
+
get(key1, key2) {
|
|
2092
|
+
const childMap = this._map.get(key1);
|
|
2093
|
+
if (childMap === void 0) {
|
|
2094
|
+
return void 0;
|
|
2095
|
+
}
|
|
2096
|
+
return childMap.get(key2);
|
|
2097
|
+
}
|
|
2098
|
+
set(key1, key2, value) {
|
|
2099
|
+
let childMap = this._map.get(key1);
|
|
2100
|
+
if (childMap === void 0) {
|
|
2101
|
+
childMap = /* @__PURE__ */ new WeakMap();
|
|
2102
|
+
this._map.set(key1, childMap);
|
|
2103
|
+
}
|
|
2104
|
+
childMap.set(key2, value);
|
|
2105
|
+
}
|
|
2106
|
+
};
|
|
2107
|
+
var concatComparatorsCache = new TwoKeyWeakMap();
|
|
2108
|
+
var concatComparators = (...comps) => {
|
|
2109
|
+
const [c1, c2, ...cRest] = comps;
|
|
2110
|
+
if (c2 === void 0) {
|
|
2111
|
+
return c1;
|
|
2112
|
+
}
|
|
2113
|
+
if (cRest.length > 0) {
|
|
2114
|
+
const [c3, ...cRest2] = cRest;
|
|
2115
|
+
return concatComparators(c1, concatComparators(c2, c3, ...cRest2));
|
|
2116
|
+
}
|
|
2117
|
+
const cacheEntry = concatComparatorsCache.get(c1, c2);
|
|
2118
|
+
if (cacheEntry !== void 0) return cacheEntry;
|
|
2119
|
+
const result2 = (a, b) => {
|
|
2120
|
+
const res = c1(a, b);
|
|
2121
|
+
if (res !== 0) return res;
|
|
2122
|
+
return c2(a, b);
|
|
2123
|
+
};
|
|
2124
|
+
concatComparatorsCache.set(c1, c2, result2);
|
|
2125
|
+
return result2;
|
|
2126
|
+
};
|
|
2127
|
+
var compareIds = (a, b) => {
|
|
2128
|
+
if (typeof a !== typeof b) {
|
|
2129
|
+
return typeof a < typeof b ? -1 : 1;
|
|
2130
|
+
}
|
|
2131
|
+
if (a < b) return -1;
|
|
2132
|
+
if (a > b) return 1;
|
|
2133
|
+
return 0;
|
|
2134
|
+
};
|
|
2135
|
+
var compareSelectCache = new TwoKeyWeakMap();
|
|
2136
|
+
var compareSelect = (getter2, comparator) => {
|
|
2137
|
+
const cacheEntry = compareSelectCache.get(getter2, comparator);
|
|
2138
|
+
if (cacheEntry !== void 0) return cacheEntry;
|
|
2139
|
+
const result2 = (a, b) => {
|
|
2140
|
+
const aValue = getter2(a);
|
|
2141
|
+
const bValue = getter2(b);
|
|
2142
|
+
if (aValue !== void 0 && aValue !== null) {
|
|
2143
|
+
if (bValue !== void 0 && bValue !== null) {
|
|
2144
|
+
return comparator(aValue, bValue);
|
|
2145
|
+
}
|
|
2146
|
+
return -1;
|
|
2147
|
+
}
|
|
2148
|
+
if (bValue !== void 0 && bValue !== null) {
|
|
2149
|
+
return 1;
|
|
2150
|
+
}
|
|
2151
|
+
return 0;
|
|
2152
|
+
};
|
|
2153
|
+
compareSelectCache.set(getter2, comparator, result2);
|
|
2154
|
+
return result2;
|
|
2155
|
+
};
|
|
2156
|
+
var compareNumbers = (a, b) => {
|
|
2157
|
+
if (typeof a !== typeof b) {
|
|
2158
|
+
return typeof a < typeof b ? -1 : 1;
|
|
2159
|
+
}
|
|
2160
|
+
if (a < b) return -1;
|
|
2161
|
+
if (a > b) return 1;
|
|
2162
|
+
return 0;
|
|
2163
|
+
};
|
|
2164
|
+
|
|
2057
2165
|
// src/util/smartGrouping.ts
|
|
2058
2166
|
var smartGrouping = (items, groupConfigs) => {
|
|
2059
2167
|
const itemsWithGroups = /* @__PURE__ */ new Set();
|
|
@@ -2792,7 +2900,7 @@ function memoizeValue(fn2) {
|
|
|
2792
2900
|
}
|
|
2793
2901
|
|
|
2794
2902
|
// src/Compilation.ts
|
|
2795
|
-
var _inner, _shutdown, _customModules, _Compilation_instances, createCachedAssets_fn, _rebuildModuleCaller;
|
|
2903
|
+
var _inner, _shutdown, _customModules, _addIncludeDispatcher, _Compilation_instances, createCachedAssets_fn, _rebuildModuleCaller;
|
|
2796
2904
|
var _Compilation = class _Compilation {
|
|
2797
2905
|
constructor(compiler, inner) {
|
|
2798
2906
|
__privateAdd(this, _Compilation_instances);
|
|
@@ -2808,6 +2916,7 @@ var _Compilation = class _Compilation {
|
|
|
2808
2916
|
* These fields are generally used within a plugin, so they do not need to be passed back to the Rust side.
|
|
2809
2917
|
*/
|
|
2810
2918
|
__privateAdd(this, _customModules);
|
|
2919
|
+
__privateAdd(this, _addIncludeDispatcher);
|
|
2811
2920
|
this.fileDependencies = createFakeCompilationDependencies(
|
|
2812
2921
|
() => __privateGet(this, _inner).dependencies().fileDependencies,
|
|
2813
2922
|
(d) => __privateGet(this, _inner).addFileDependencies(d)
|
|
@@ -2928,7 +3037,8 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
|
2928
3037
|
),
|
|
2929
3038
|
runtimeModule: new liteTapable.SyncHook(["module", "chunk"]),
|
|
2930
3039
|
seal: new liteTapable.SyncHook([]),
|
|
2931
|
-
afterSeal: new liteTapable.AsyncSeriesHook([])
|
|
3040
|
+
afterSeal: new liteTapable.AsyncSeriesHook([]),
|
|
3041
|
+
needAdditionalPass: new liteTapable.SyncBailHook([])
|
|
2932
3042
|
};
|
|
2933
3043
|
this.compiler = compiler;
|
|
2934
3044
|
this.resolverFactory = compiler.resolverFactory;
|
|
@@ -2938,8 +3048,12 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
|
2938
3048
|
this.logging = /* @__PURE__ */ new Map();
|
|
2939
3049
|
this.childrenCounters = {};
|
|
2940
3050
|
this.children = [];
|
|
2941
|
-
this.
|
|
3051
|
+
this.needAdditionalPass = false;
|
|
3052
|
+
this.chunkGraph = ChunkGraph.__from_binding(inner.chunkGraph);
|
|
2942
3053
|
this.moduleGraph = ModuleGraph.__from_binding(inner.moduleGraph);
|
|
3054
|
+
__privateSet(this, _addIncludeDispatcher, new AddIncludeDispatcher(
|
|
3055
|
+
inner.addInclude.bind(inner)
|
|
3056
|
+
));
|
|
2943
3057
|
}
|
|
2944
3058
|
get hash() {
|
|
2945
3059
|
return __privateGet(this, _inner).hash;
|
|
@@ -2961,16 +3075,14 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
|
2961
3075
|
() => new Map(
|
|
2962
3076
|
Object.entries(__privateGet(this, _inner).entrypoints).map(([n, e]) => [
|
|
2963
3077
|
n,
|
|
2964
|
-
Entrypoint.__from_binding(e
|
|
3078
|
+
Entrypoint.__from_binding(e)
|
|
2965
3079
|
])
|
|
2966
3080
|
)
|
|
2967
3081
|
);
|
|
2968
3082
|
}
|
|
2969
3083
|
get chunkGroups() {
|
|
2970
3084
|
return memoizeValue(
|
|
2971
|
-
() => __privateGet(this, _inner).chunkGroups.map(
|
|
2972
|
-
(cg) => ChunkGroup.__from_binding(cg, __privateGet(this, _inner))
|
|
2973
|
-
)
|
|
3085
|
+
() => __privateGet(this, _inner).chunkGroups.map((binding3) => ChunkGroup.__from_binding(binding3))
|
|
2974
3086
|
);
|
|
2975
3087
|
}
|
|
2976
3088
|
/**
|
|
@@ -2986,8 +3098,8 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
|
2986
3098
|
},
|
|
2987
3099
|
get: (property) => {
|
|
2988
3100
|
if (typeof property === "string") {
|
|
2989
|
-
const
|
|
2990
|
-
return
|
|
3101
|
+
const binding3 = __privateGet(this, _inner).getNamedChunkGroup(property);
|
|
3102
|
+
return ChunkGroup.__from_binding(binding3);
|
|
2991
3103
|
}
|
|
2992
3104
|
}
|
|
2993
3105
|
});
|
|
@@ -3020,8 +3132,8 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
|
3020
3132
|
},
|
|
3021
3133
|
get: (property) => {
|
|
3022
3134
|
if (typeof property === "string") {
|
|
3023
|
-
const
|
|
3024
|
-
return
|
|
3135
|
+
const binding3 = __privateGet(this, _inner).getNamedChunk(property);
|
|
3136
|
+
return Chunk.__from_binding(binding3);
|
|
3025
3137
|
}
|
|
3026
3138
|
}
|
|
3027
3139
|
});
|
|
@@ -3194,7 +3306,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
|
3194
3306
|
for (let i = 0; i < errs.length; i++) {
|
|
3195
3307
|
const error = errs[i];
|
|
3196
3308
|
inner.pushDiagnostic(
|
|
3197
|
-
JsRspackDiagnostic.__to_binding(error,
|
|
3309
|
+
JsRspackDiagnostic.__to_binding(error, import_binding2.JsRspackSeverity.Error)
|
|
3198
3310
|
);
|
|
3199
3311
|
}
|
|
3200
3312
|
return Reflect.apply(target2, thisArg, errs);
|
|
@@ -3220,7 +3332,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
|
3220
3332
|
const errList = errs.map((error) => {
|
|
3221
3333
|
return JsRspackDiagnostic.__to_binding(
|
|
3222
3334
|
error,
|
|
3223
|
-
|
|
3335
|
+
import_binding2.JsRspackSeverity.Error
|
|
3224
3336
|
);
|
|
3225
3337
|
});
|
|
3226
3338
|
inner.spliceDiagnostic(0, 0, errList);
|
|
@@ -3233,7 +3345,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
|
3233
3345
|
const errList = errors2.map((error) => {
|
|
3234
3346
|
return JsRspackDiagnostic.__to_binding(
|
|
3235
3347
|
error,
|
|
3236
|
-
|
|
3348
|
+
import_binding2.JsRspackSeverity.Error
|
|
3237
3349
|
);
|
|
3238
3350
|
});
|
|
3239
3351
|
inner.spliceDiagnostic(startIdx, startIdx + delCount, errList);
|
|
@@ -3260,7 +3372,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
|
3260
3372
|
0,
|
|
3261
3373
|
length,
|
|
3262
3374
|
errors.map((error) => {
|
|
3263
|
-
return JsRspackDiagnostic.__to_binding(error,
|
|
3375
|
+
return JsRspackDiagnostic.__to_binding(error, import_binding2.JsRspackSeverity.Error);
|
|
3264
3376
|
})
|
|
3265
3377
|
);
|
|
3266
3378
|
}
|
|
@@ -3277,7 +3389,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
|
3277
3389
|
thisArg,
|
|
3278
3390
|
processWarningsHook.call(warns).map((warn) => {
|
|
3279
3391
|
inner.pushDiagnostic(
|
|
3280
|
-
JsRspackDiagnostic.__to_binding(warn,
|
|
3392
|
+
JsRspackDiagnostic.__to_binding(warn, import_binding2.JsRspackSeverity.Warn)
|
|
3281
3393
|
);
|
|
3282
3394
|
return warn;
|
|
3283
3395
|
})
|
|
@@ -3308,7 +3420,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
|
3308
3420
|
warnings2.map((warn) => {
|
|
3309
3421
|
return JsRspackDiagnostic.__to_binding(
|
|
3310
3422
|
warn,
|
|
3311
|
-
|
|
3423
|
+
import_binding2.JsRspackSeverity.Warn
|
|
3312
3424
|
);
|
|
3313
3425
|
})
|
|
3314
3426
|
);
|
|
@@ -3320,7 +3432,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
|
3320
3432
|
handler(target2, thisArg, [startIdx, delCount, ...warns]) {
|
|
3321
3433
|
warns = processWarningsHook.call(warns);
|
|
3322
3434
|
const warnList = warns.map((warn) => {
|
|
3323
|
-
return JsRspackDiagnostic.__to_binding(warn,
|
|
3435
|
+
return JsRspackDiagnostic.__to_binding(warn, import_binding2.JsRspackSeverity.Warn);
|
|
3324
3436
|
});
|
|
3325
3437
|
inner.spliceDiagnostic(startIdx, startIdx + delCount, warnList);
|
|
3326
3438
|
return Reflect.apply(target2, thisArg, [
|
|
@@ -3346,7 +3458,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
|
3346
3458
|
0,
|
|
3347
3459
|
length,
|
|
3348
3460
|
warnings.map((warning) => {
|
|
3349
|
-
return JsRspackDiagnostic.__to_binding(warning,
|
|
3461
|
+
return JsRspackDiagnostic.__to_binding(warning, import_binding2.JsRspackSeverity.Warn);
|
|
3350
3462
|
})
|
|
3351
3463
|
);
|
|
3352
3464
|
}
|
|
@@ -3506,10 +3618,13 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
|
3506
3618
|
addRuntimeModule(chunk, runtimeModule) {
|
|
3507
3619
|
runtimeModule.attach(this, chunk, this.chunkGraph);
|
|
3508
3620
|
__privateGet(this, _inner).addRuntimeModule(
|
|
3509
|
-
|
|
3621
|
+
Chunk.__to_binding(chunk),
|
|
3510
3622
|
RuntimeModule.__to_binding(this, runtimeModule)
|
|
3511
3623
|
);
|
|
3512
3624
|
}
|
|
3625
|
+
addInclude(context2, dependency, options, callback) {
|
|
3626
|
+
__privateGet(this, _addIncludeDispatcher).call(context2, dependency, options, callback);
|
|
3627
|
+
}
|
|
3513
3628
|
/**
|
|
3514
3629
|
* Get the `Source` of a given asset filename.
|
|
3515
3630
|
*
|
|
@@ -3570,7 +3685,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
|
3570
3685
|
* @internal
|
|
3571
3686
|
*/
|
|
3572
3687
|
__internal__getChunks() {
|
|
3573
|
-
return __privateGet(this, _inner).getChunks().map((
|
|
3688
|
+
return __privateGet(this, _inner).getChunks().map((binding3) => Chunk.__from_binding(binding3));
|
|
3574
3689
|
}
|
|
3575
3690
|
/**
|
|
3576
3691
|
* Note: This is not a webpack public API, maybe removed in future.
|
|
@@ -3594,6 +3709,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
|
3594
3709
|
_inner = new WeakMap();
|
|
3595
3710
|
_shutdown = new WeakMap();
|
|
3596
3711
|
_customModules = new WeakMap();
|
|
3712
|
+
_addIncludeDispatcher = new WeakMap();
|
|
3597
3713
|
_Compilation_instances = new WeakSet();
|
|
3598
3714
|
createCachedAssets_fn = function() {
|
|
3599
3715
|
return new Proxy(
|
|
@@ -3654,6 +3770,52 @@ _Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_TRANSFER = 3e3;
|
|
|
3654
3770
|
_Compilation.PROCESS_ASSETS_STAGE_ANALYSE = 4e3;
|
|
3655
3771
|
_Compilation.PROCESS_ASSETS_STAGE_REPORT = 5e3;
|
|
3656
3772
|
var Compilation = _Compilation;
|
|
3773
|
+
var AddIncludeDispatcher = class {
|
|
3774
|
+
#inner;
|
|
3775
|
+
#running;
|
|
3776
|
+
#args = [];
|
|
3777
|
+
#cbs = [];
|
|
3778
|
+
#execute = () => {
|
|
3779
|
+
if (this.#running) {
|
|
3780
|
+
return;
|
|
3781
|
+
}
|
|
3782
|
+
const args = this.#args;
|
|
3783
|
+
this.#args = [];
|
|
3784
|
+
const cbs = this.#cbs;
|
|
3785
|
+
this.#cbs = [];
|
|
3786
|
+
this.#inner(args, (wholeErr, results) => {
|
|
3787
|
+
if (this.#args.length !== 0) {
|
|
3788
|
+
queueMicrotask(this.#execute);
|
|
3789
|
+
}
|
|
3790
|
+
if (wholeErr) {
|
|
3791
|
+
const webpackError = new WebpackError_default(wholeErr.message);
|
|
3792
|
+
for (const cb of cbs) {
|
|
3793
|
+
cb(webpackError);
|
|
3794
|
+
}
|
|
3795
|
+
return;
|
|
3796
|
+
}
|
|
3797
|
+
for (let i = 0; i < results.length; i++) {
|
|
3798
|
+
const [errMsg, moduleBinding] = results[i];
|
|
3799
|
+
const cb = cbs[i];
|
|
3800
|
+
cb(
|
|
3801
|
+
errMsg ? new WebpackError_default(errMsg) : null,
|
|
3802
|
+
Module.__from_binding(moduleBinding)
|
|
3803
|
+
);
|
|
3804
|
+
}
|
|
3805
|
+
});
|
|
3806
|
+
};
|
|
3807
|
+
constructor(binding3) {
|
|
3808
|
+
this.#inner = binding3;
|
|
3809
|
+
this.#running = false;
|
|
3810
|
+
}
|
|
3811
|
+
call(context2, dependency, options, callback) {
|
|
3812
|
+
if (this.#args.length === 0) {
|
|
3813
|
+
queueMicrotask(this.#execute);
|
|
3814
|
+
}
|
|
3815
|
+
this.#args.push([context2, dependency, options]);
|
|
3816
|
+
this.#cbs.push(callback);
|
|
3817
|
+
}
|
|
3818
|
+
};
|
|
3657
3819
|
var EntryData = class _EntryData {
|
|
3658
3820
|
static __from_binding(binding3) {
|
|
3659
3821
|
return new _EntryData(binding3);
|
|
@@ -3789,16 +3951,6 @@ var ConcurrentCompilationError = class extends Error {
|
|
|
3789
3951
|
// src/lib/Cache.ts
|
|
3790
3952
|
var import_lite_tapable3 = require("@rspack/lite-tapable");
|
|
3791
3953
|
|
|
3792
|
-
// src/lib/WebpackError.ts
|
|
3793
|
-
var import_node_util = require("util");
|
|
3794
|
-
var WebpackError = class extends Error {
|
|
3795
|
-
[import_node_util.inspect.custom]() {
|
|
3796
|
-
return this.stack + (this.details ? `
|
|
3797
|
-
${this.details}` : "");
|
|
3798
|
-
}
|
|
3799
|
-
};
|
|
3800
|
-
var WebpackError_default = WebpackError;
|
|
3801
|
-
|
|
3802
3954
|
// src/lib/HookWebpackError.ts
|
|
3803
3955
|
var HookWebpackError = class extends WebpackError_default {
|
|
3804
3956
|
/**
|
|
@@ -5142,40 +5294,40 @@ function create2(name2, resolve2, affectedHooks) {
|
|
|
5142
5294
|
}
|
|
5143
5295
|
|
|
5144
5296
|
// src/builtin-plugin/APIPlugin.ts
|
|
5145
|
-
var
|
|
5146
|
-
var APIPlugin = create2(
|
|
5297
|
+
var import_binding3 = require("@rspack/binding");
|
|
5298
|
+
var APIPlugin = create2(import_binding3.BuiltinPluginName.APIPlugin, () => {
|
|
5147
5299
|
});
|
|
5148
5300
|
|
|
5149
5301
|
// src/builtin-plugin/ArrayPushCallbackChunkFormatPlugin.ts
|
|
5150
|
-
var
|
|
5302
|
+
var import_binding4 = require("@rspack/binding");
|
|
5151
5303
|
var ArrayPushCallbackChunkFormatPlugin = create2(
|
|
5152
|
-
|
|
5304
|
+
import_binding4.BuiltinPluginName.ArrayPushCallbackChunkFormatPlugin,
|
|
5153
5305
|
() => {
|
|
5154
5306
|
}
|
|
5155
5307
|
);
|
|
5156
5308
|
|
|
5157
5309
|
// src/builtin-plugin/AssetModulesPlugin.ts
|
|
5158
|
-
var
|
|
5310
|
+
var import_binding5 = require("@rspack/binding");
|
|
5159
5311
|
var AssetModulesPlugin = create2(
|
|
5160
|
-
|
|
5312
|
+
import_binding5.BuiltinPluginName.AssetModulesPlugin,
|
|
5161
5313
|
() => {
|
|
5162
5314
|
},
|
|
5163
5315
|
"compilation"
|
|
5164
5316
|
);
|
|
5165
5317
|
|
|
5166
5318
|
// src/builtin-plugin/AsyncWebAssemblyModulesPlugin.ts
|
|
5167
|
-
var
|
|
5319
|
+
var import_binding6 = require("@rspack/binding");
|
|
5168
5320
|
var AsyncWebAssemblyModulesPlugin = create2(
|
|
5169
|
-
|
|
5321
|
+
import_binding6.BuiltinPluginName.AsyncWebAssemblyModulesPlugin,
|
|
5170
5322
|
() => {
|
|
5171
5323
|
},
|
|
5172
5324
|
"compilation"
|
|
5173
5325
|
);
|
|
5174
5326
|
|
|
5175
5327
|
// src/builtin-plugin/BannerPlugin.ts
|
|
5176
|
-
var
|
|
5328
|
+
var import_binding7 = require("@rspack/binding");
|
|
5177
5329
|
var BannerPlugin = create2(
|
|
5178
|
-
|
|
5330
|
+
import_binding7.BuiltinPluginName.BannerPlugin,
|
|
5179
5331
|
(args) => {
|
|
5180
5332
|
if (typeof args === "string" || typeof args === "function") {
|
|
5181
5333
|
return {
|
|
@@ -5196,9 +5348,9 @@ var BannerPlugin = create2(
|
|
|
5196
5348
|
);
|
|
5197
5349
|
|
|
5198
5350
|
// src/builtin-plugin/BundlerInfoRspackPlugin.ts
|
|
5199
|
-
var
|
|
5351
|
+
var import_binding8 = require("@rspack/binding");
|
|
5200
5352
|
var BundlerInfoRspackPlugin = create2(
|
|
5201
|
-
|
|
5353
|
+
import_binding8.BuiltinPluginName.BundlerInfoRspackPlugin,
|
|
5202
5354
|
(options) => {
|
|
5203
5355
|
return {
|
|
5204
5356
|
version: options.version || "unknown",
|
|
@@ -5209,25 +5361,25 @@ var BundlerInfoRspackPlugin = create2(
|
|
|
5209
5361
|
);
|
|
5210
5362
|
|
|
5211
5363
|
// src/builtin-plugin/ChunkPrefetchPreloadPlugin.ts
|
|
5212
|
-
var
|
|
5364
|
+
var import_binding9 = require("@rspack/binding");
|
|
5213
5365
|
var ChunkPrefetchPreloadPlugin = create2(
|
|
5214
|
-
|
|
5366
|
+
import_binding9.BuiltinPluginName.ChunkPrefetchPreloadPlugin,
|
|
5215
5367
|
() => {
|
|
5216
5368
|
}
|
|
5217
5369
|
);
|
|
5218
5370
|
|
|
5219
5371
|
// src/builtin-plugin/CommonJsChunkFormatPlugin.ts
|
|
5220
|
-
var
|
|
5372
|
+
var import_binding10 = require("@rspack/binding");
|
|
5221
5373
|
var CommonJsChunkFormatPlugin = create2(
|
|
5222
|
-
|
|
5374
|
+
import_binding10.BuiltinPluginName.CommonJsChunkFormatPlugin,
|
|
5223
5375
|
() => {
|
|
5224
5376
|
}
|
|
5225
5377
|
);
|
|
5226
5378
|
|
|
5227
5379
|
// src/builtin-plugin/CopyRspackPlugin.ts
|
|
5228
|
-
var
|
|
5380
|
+
var import_binding11 = require("@rspack/binding");
|
|
5229
5381
|
var CopyRspackPlugin = create2(
|
|
5230
|
-
|
|
5382
|
+
import_binding11.BuiltinPluginName.CopyRspackPlugin,
|
|
5231
5383
|
(copy) => {
|
|
5232
5384
|
const ret = {
|
|
5233
5385
|
patterns: []
|
|
@@ -5247,7 +5399,7 @@ var CopyRspackPlugin = create2(
|
|
|
5247
5399
|
);
|
|
5248
5400
|
|
|
5249
5401
|
// src/builtin-plugin/css-extract/index.ts
|
|
5250
|
-
var
|
|
5402
|
+
var import_binding12 = require("@rspack/binding");
|
|
5251
5403
|
var import_node_path3 = require("path");
|
|
5252
5404
|
|
|
5253
5405
|
// src/builtin-plugin/css-extract/loader.ts
|
|
@@ -5283,7 +5435,7 @@ var CssExtractRspackPlugin = class {
|
|
|
5283
5435
|
this.options.pathinfo = true;
|
|
5284
5436
|
}
|
|
5285
5437
|
compiler.__internal__registerBuiltinPlugin({
|
|
5286
|
-
name:
|
|
5438
|
+
name: import_binding12.BuiltinPluginName.CssExtractRspackPlugin,
|
|
5287
5439
|
options: this.normalizeOptions(this.options)
|
|
5288
5440
|
});
|
|
5289
5441
|
}
|
|
@@ -5341,27 +5493,27 @@ CssExtractRspackPlugin.pluginName = PLUGIN_NAME;
|
|
|
5341
5493
|
CssExtractRspackPlugin.loader = LOADER_PATH;
|
|
5342
5494
|
|
|
5343
5495
|
// src/builtin-plugin/CssModulesPlugin.ts
|
|
5344
|
-
var
|
|
5496
|
+
var import_binding13 = require("@rspack/binding");
|
|
5345
5497
|
var CssModulesPlugin = create2(
|
|
5346
|
-
|
|
5498
|
+
import_binding13.BuiltinPluginName.CssModulesPlugin,
|
|
5347
5499
|
() => {
|
|
5348
5500
|
},
|
|
5349
5501
|
"compilation"
|
|
5350
5502
|
);
|
|
5351
5503
|
|
|
5352
5504
|
// src/builtin-plugin/DataUriPlugin.ts
|
|
5353
|
-
var
|
|
5505
|
+
var import_binding14 = require("@rspack/binding");
|
|
5354
5506
|
var DataUriPlugin = create2(
|
|
5355
|
-
|
|
5507
|
+
import_binding14.BuiltinPluginName.DataUriPlugin,
|
|
5356
5508
|
() => {
|
|
5357
5509
|
},
|
|
5358
5510
|
"compilation"
|
|
5359
5511
|
);
|
|
5360
5512
|
|
|
5361
5513
|
// src/builtin-plugin/DefinePlugin.ts
|
|
5362
|
-
var
|
|
5514
|
+
var import_binding15 = require("@rspack/binding");
|
|
5363
5515
|
var DefinePlugin = create2(
|
|
5364
|
-
|
|
5516
|
+
import_binding15.BuiltinPluginName.DefinePlugin,
|
|
5365
5517
|
function(define) {
|
|
5366
5518
|
var _a;
|
|
5367
5519
|
const supportsBigIntLiteral = ((_a = this.options.output.environment) == null ? void 0 : _a.bigIntLiteral) ?? false;
|
|
@@ -5399,26 +5551,40 @@ var normalizeValue = (define, supportsBigIntLiteral) => {
|
|
|
5399
5551
|
const keys = Object.keys(define2);
|
|
5400
5552
|
return Object.fromEntries(keys.map((k) => [k, normalizeObject(define2[k])]));
|
|
5401
5553
|
}
|
|
5402
|
-
return normalizePrimitive(define2);
|
|
5403
|
-
};
|
|
5404
|
-
return normalizeObject(define);
|
|
5554
|
+
return normalizePrimitive(define2);
|
|
5555
|
+
};
|
|
5556
|
+
return normalizeObject(define);
|
|
5557
|
+
};
|
|
5558
|
+
|
|
5559
|
+
// src/builtin-plugin/DeterministicChunkIdsPlugin.ts
|
|
5560
|
+
var import_binding16 = require("@rspack/binding");
|
|
5561
|
+
var DeterministicChunkIdsPlugin = class extends RspackBuiltinPlugin {
|
|
5562
|
+
constructor() {
|
|
5563
|
+
super(...arguments);
|
|
5564
|
+
this.name = import_binding16.BuiltinPluginName.DeterministicChunkIdsPlugin;
|
|
5565
|
+
this.affectedHooks = "compilation";
|
|
5566
|
+
}
|
|
5567
|
+
raw(compiler) {
|
|
5568
|
+
const incremental2 = compiler.options.experiments.incremental;
|
|
5569
|
+
const logger = compiler.getInfrastructureLogger(
|
|
5570
|
+
"rspack.DeterministicChunkIdsPlugin"
|
|
5571
|
+
);
|
|
5572
|
+
if (incremental2.chunkIds) {
|
|
5573
|
+
incremental2.chunkIds = false;
|
|
5574
|
+
logger.warn(
|
|
5575
|
+
"`optimization.chunkIds = 'deterministic'` can't be used with `incremental.chunkIds` as deterministic chunk ids is a global effect. `incremental.chunkIds` has been overridden to false. We recommend enabling incremental only in the development mode."
|
|
5576
|
+
);
|
|
5577
|
+
}
|
|
5578
|
+
return createBuiltinPlugin(this.name, void 0);
|
|
5579
|
+
}
|
|
5405
5580
|
};
|
|
5406
5581
|
|
|
5407
|
-
// src/builtin-plugin/DeterministicChunkIdsPlugin.ts
|
|
5408
|
-
var import_binding20 = require("@rspack/binding");
|
|
5409
|
-
var DeterministicChunkIdsPlugin = create2(
|
|
5410
|
-
import_binding20.BuiltinPluginName.DeterministicChunkIdsPlugin,
|
|
5411
|
-
() => {
|
|
5412
|
-
},
|
|
5413
|
-
"compilation"
|
|
5414
|
-
);
|
|
5415
|
-
|
|
5416
5582
|
// src/builtin-plugin/DeterministicModuleIdsPlugin.ts
|
|
5417
|
-
var
|
|
5583
|
+
var import_binding17 = require("@rspack/binding");
|
|
5418
5584
|
var DeterministicModuleIdsPlugin = class extends RspackBuiltinPlugin {
|
|
5419
5585
|
constructor() {
|
|
5420
5586
|
super(...arguments);
|
|
5421
|
-
this.name =
|
|
5587
|
+
this.name = import_binding17.BuiltinPluginName.DeterministicModuleIdsPlugin;
|
|
5422
5588
|
this.affectedHooks = "compilation";
|
|
5423
5589
|
}
|
|
5424
5590
|
raw(compiler) {
|
|
@@ -5429,7 +5595,7 @@ var DeterministicModuleIdsPlugin = class extends RspackBuiltinPlugin {
|
|
|
5429
5595
|
if (incremental2.moduleIds) {
|
|
5430
5596
|
incremental2.moduleIds = false;
|
|
5431
5597
|
logger.warn(
|
|
5432
|
-
"`optimization.moduleIds = 'deterministic'` can't be used with `incremental.moduleIds` as deterministic module ids is a global effect. `incremental.moduleIds` has been overridden to false."
|
|
5598
|
+
"`optimization.moduleIds = 'deterministic'` can't be used with `incremental.moduleIds` as deterministic module ids is a global effect. `incremental.moduleIds` has been overridden to false. We recommend enabling incremental only in the development mode."
|
|
5433
5599
|
);
|
|
5434
5600
|
}
|
|
5435
5601
|
return createBuiltinPlugin(this.name, void 0);
|
|
@@ -5437,7 +5603,7 @@ var DeterministicModuleIdsPlugin = class extends RspackBuiltinPlugin {
|
|
|
5437
5603
|
};
|
|
5438
5604
|
|
|
5439
5605
|
// src/builtin-plugin/DynamicEntryPlugin.ts
|
|
5440
|
-
var
|
|
5606
|
+
var import_binding19 = require("@rspack/binding");
|
|
5441
5607
|
|
|
5442
5608
|
// src/lib/EntryOptionPlugin.ts
|
|
5443
5609
|
var import_node_assert = __toESM(require("assert"));
|
|
@@ -5510,11 +5676,170 @@ var EntryOptionPlugin = class _EntryOptionPlugin {
|
|
|
5510
5676
|
var EntryOptionPlugin_default = EntryOptionPlugin;
|
|
5511
5677
|
|
|
5512
5678
|
// src/builtin-plugin/EntryPlugin.ts
|
|
5679
|
+
var import_binding18 = require("@rspack/binding");
|
|
5680
|
+
var OriginEntryPlugin = create2(
|
|
5681
|
+
import_binding18.BuiltinPluginName.EntryPlugin,
|
|
5682
|
+
(context2, entry2, options = "") => {
|
|
5683
|
+
const entryOptions = typeof options === "string" ? { name: options } : options;
|
|
5684
|
+
return {
|
|
5685
|
+
context: context2,
|
|
5686
|
+
entry: entry2,
|
|
5687
|
+
options: getRawEntryOptions(entryOptions)
|
|
5688
|
+
};
|
|
5689
|
+
},
|
|
5690
|
+
"make"
|
|
5691
|
+
);
|
|
5692
|
+
var EntryPlugin = OriginEntryPlugin;
|
|
5693
|
+
EntryPlugin.createDependency = (request) => {
|
|
5694
|
+
return {
|
|
5695
|
+
request
|
|
5696
|
+
};
|
|
5697
|
+
};
|
|
5698
|
+
function getRawEntryOptions(entry2) {
|
|
5699
|
+
const runtime = entry2.runtime;
|
|
5700
|
+
const chunkLoading2 = entry2.chunkLoading;
|
|
5701
|
+
return {
|
|
5702
|
+
name: entry2.name,
|
|
5703
|
+
publicPath: entry2.publicPath,
|
|
5704
|
+
baseUri: entry2.baseUri,
|
|
5705
|
+
runtime,
|
|
5706
|
+
chunkLoading: chunkLoading2,
|
|
5707
|
+
asyncChunks: entry2.asyncChunks,
|
|
5708
|
+
filename: entry2.filename,
|
|
5709
|
+
library: entry2.library,
|
|
5710
|
+
layer: entry2.layer ?? void 0,
|
|
5711
|
+
dependOn: entry2.dependOn
|
|
5712
|
+
};
|
|
5713
|
+
}
|
|
5714
|
+
|
|
5715
|
+
// src/builtin-plugin/DynamicEntryPlugin.ts
|
|
5716
|
+
var DynamicEntryPlugin = class extends RspackBuiltinPlugin {
|
|
5717
|
+
constructor(context2, entry2) {
|
|
5718
|
+
super();
|
|
5719
|
+
this.context = context2;
|
|
5720
|
+
this.entry = entry2;
|
|
5721
|
+
this.name = import_binding19.BuiltinPluginName.DynamicEntryPlugin;
|
|
5722
|
+
this.affectedHooks = "make";
|
|
5723
|
+
}
|
|
5724
|
+
raw(compiler) {
|
|
5725
|
+
const raw = {
|
|
5726
|
+
context: this.context,
|
|
5727
|
+
entry: async () => {
|
|
5728
|
+
const result2 = await this.entry();
|
|
5729
|
+
return Object.entries(result2).map(([name2, desc]) => {
|
|
5730
|
+
const options = EntryOptionPlugin_default.entryDescriptionToOptions(
|
|
5731
|
+
compiler,
|
|
5732
|
+
name2,
|
|
5733
|
+
desc
|
|
5734
|
+
);
|
|
5735
|
+
return {
|
|
5736
|
+
import: desc.import,
|
|
5737
|
+
options: getRawEntryOptions(options)
|
|
5738
|
+
};
|
|
5739
|
+
});
|
|
5740
|
+
}
|
|
5741
|
+
};
|
|
5742
|
+
return createBuiltinPlugin(this.name, raw);
|
|
5743
|
+
}
|
|
5744
|
+
};
|
|
5745
|
+
|
|
5746
|
+
// src/builtin-plugin/ElectronTargetPlugin.ts
|
|
5747
|
+
var import_binding20 = require("@rspack/binding");
|
|
5748
|
+
var ElectronTargetPlugin = create2(
|
|
5749
|
+
import_binding20.BuiltinPluginName.ElectronTargetPlugin,
|
|
5750
|
+
(context2) => context2 ?? "none"
|
|
5751
|
+
);
|
|
5752
|
+
|
|
5753
|
+
// src/builtin-plugin/EnableChunkLoadingPlugin.ts
|
|
5754
|
+
var import_binding21 = require("@rspack/binding");
|
|
5755
|
+
var EnableChunkLoadingPlugin = create2(
|
|
5756
|
+
import_binding21.BuiltinPluginName.EnableChunkLoadingPlugin,
|
|
5757
|
+
(type) => type
|
|
5758
|
+
);
|
|
5759
|
+
|
|
5760
|
+
// src/builtin-plugin/EnableLibraryPlugin.ts
|
|
5761
|
+
var import_binding22 = require("@rspack/binding");
|
|
5762
|
+
var enabledTypes = /* @__PURE__ */ new WeakMap();
|
|
5763
|
+
var getEnabledTypes = (compiler) => {
|
|
5764
|
+
let set = enabledTypes.get(compiler);
|
|
5765
|
+
if (set === void 0) {
|
|
5766
|
+
set = /* @__PURE__ */ new Set();
|
|
5767
|
+
enabledTypes.set(compiler, set);
|
|
5768
|
+
}
|
|
5769
|
+
return set;
|
|
5770
|
+
};
|
|
5771
|
+
var EnableLibraryPlugin = class extends RspackBuiltinPlugin {
|
|
5772
|
+
constructor(type) {
|
|
5773
|
+
super();
|
|
5774
|
+
this.type = type;
|
|
5775
|
+
this.name = import_binding22.BuiltinPluginName.EnableLibraryPlugin;
|
|
5776
|
+
}
|
|
5777
|
+
static setEnabled(compiler, type) {
|
|
5778
|
+
getEnabledTypes(compiler).add(type);
|
|
5779
|
+
}
|
|
5780
|
+
static checkEnabled(compiler, type) {
|
|
5781
|
+
if (!getEnabledTypes(compiler).has(type)) {
|
|
5782
|
+
throw new Error(
|
|
5783
|
+
`Library type "${type}" is not enabled. EnableLibraryPlugin need to be used to enable this type of library. This usually happens through the "output.enabledLibraryTypes" option. If you are using a function as entry which sets "library", you need to add all potential library types to "output.enabledLibraryTypes". These types are enabled: ${Array.from(getEnabledTypes(compiler)).join(", ")}`
|
|
5784
|
+
);
|
|
5785
|
+
}
|
|
5786
|
+
}
|
|
5787
|
+
raw(compiler) {
|
|
5788
|
+
const { type } = this;
|
|
5789
|
+
const enabled = getEnabledTypes(compiler);
|
|
5790
|
+
if (enabled.has(type)) return;
|
|
5791
|
+
enabled.add(type);
|
|
5792
|
+
return createBuiltinPlugin(this.name, type);
|
|
5793
|
+
}
|
|
5794
|
+
};
|
|
5795
|
+
|
|
5796
|
+
// src/builtin-plugin/EnableWasmLoadingPlugin.ts
|
|
5797
|
+
var import_binding23 = require("@rspack/binding");
|
|
5798
|
+
var EnableWasmLoadingPlugin = create2(
|
|
5799
|
+
import_binding23.BuiltinPluginName.EnableWasmLoadingPlugin,
|
|
5800
|
+
(type) => type
|
|
5801
|
+
);
|
|
5802
|
+
|
|
5803
|
+
// src/builtin-plugin/EnsureChunkConditionsPlugin.ts
|
|
5513
5804
|
var import_binding24 = require("@rspack/binding");
|
|
5805
|
+
var EnsureChunkConditionsPlugin = create2(
|
|
5806
|
+
import_binding24.BuiltinPluginName.EnsureChunkConditionsPlugin,
|
|
5807
|
+
() => {
|
|
5808
|
+
}
|
|
5809
|
+
);
|
|
5810
|
+
|
|
5811
|
+
// src/builtin-plugin/EvalDevToolModulePlugin.ts
|
|
5812
|
+
var import_binding25 = require("@rspack/binding");
|
|
5813
|
+
var EvalDevToolModulePlugin = create2(
|
|
5814
|
+
import_binding25.BuiltinPluginName.EvalDevToolModulePlugin,
|
|
5815
|
+
(options) => options,
|
|
5816
|
+
"compilation"
|
|
5817
|
+
);
|
|
5818
|
+
|
|
5819
|
+
// src/builtin-plugin/EvalSourceMapDevToolPlugin.ts
|
|
5820
|
+
var import_binding26 = require("@rspack/binding");
|
|
5821
|
+
var EvalSourceMapDevToolPlugin = create2(
|
|
5822
|
+
import_binding26.BuiltinPluginName.EvalSourceMapDevToolPlugin,
|
|
5823
|
+
(options) => {
|
|
5824
|
+
return {
|
|
5825
|
+
filename: options.filename || void 0,
|
|
5826
|
+
append: options.append,
|
|
5827
|
+
namespace: options.namespace ?? "",
|
|
5828
|
+
columns: options.columns ?? true,
|
|
5829
|
+
noSources: options.noSources ?? false,
|
|
5830
|
+
publicPath: options.publicPath,
|
|
5831
|
+
module: options.module
|
|
5832
|
+
};
|
|
5833
|
+
},
|
|
5834
|
+
"compilation"
|
|
5835
|
+
);
|
|
5836
|
+
|
|
5837
|
+
// src/builtin-plugin/ExternalsPlugin.ts
|
|
5838
|
+
var import_binding29 = require("@rspack/binding");
|
|
5514
5839
|
|
|
5515
5840
|
// src/config/adapter.ts
|
|
5516
5841
|
var import_node_assert3 = __toESM(require("assert"));
|
|
5517
|
-
var
|
|
5842
|
+
var import_binding28 = require("@rspack/binding");
|
|
5518
5843
|
|
|
5519
5844
|
// src/util/identifier.ts
|
|
5520
5845
|
var import_node_path4 = __toESM(require("path"));
|
|
@@ -5822,7 +6147,7 @@ function toFeatures(featureOptions) {
|
|
|
5822
6147
|
var import_node_querystring = __toESM(require("querystring"));
|
|
5823
6148
|
var import_node_assert2 = __toESM(require("assert"));
|
|
5824
6149
|
var import_node_util3 = require("util");
|
|
5825
|
-
var
|
|
6150
|
+
var import_binding27 = require("@rspack/binding");
|
|
5826
6151
|
var import_webpack_sources2 = require("../compiled/webpack-sources/index.js");
|
|
5827
6152
|
|
|
5828
6153
|
// src/NormalModule.ts
|
|
@@ -6023,7 +6348,7 @@ var LoaderObject = class {
|
|
|
6023
6348
|
constructor(loaderItem, compiler) {
|
|
6024
6349
|
const {
|
|
6025
6350
|
request,
|
|
6026
|
-
path:
|
|
6351
|
+
path: path11,
|
|
6027
6352
|
query,
|
|
6028
6353
|
fragment,
|
|
6029
6354
|
options,
|
|
@@ -6034,7 +6359,7 @@ var LoaderObject = class {
|
|
|
6034
6359
|
type
|
|
6035
6360
|
} = createLoaderObject(loaderItem, compiler);
|
|
6036
6361
|
this.request = request;
|
|
6037
|
-
this.path =
|
|
6362
|
+
this.path = path11;
|
|
6038
6363
|
this.query = query;
|
|
6039
6364
|
this.fragment = fragment;
|
|
6040
6365
|
this.options = options;
|
|
@@ -6161,17 +6486,17 @@ var runSyncOrAsync = (0, import_node_util3.promisify)(function runSyncOrAsync2(f
|
|
|
6161
6486
|
callback(e, []);
|
|
6162
6487
|
}
|
|
6163
6488
|
});
|
|
6164
|
-
function dirname(
|
|
6165
|
-
if (
|
|
6166
|
-
const i =
|
|
6167
|
-
const j =
|
|
6168
|
-
const i2 =
|
|
6169
|
-
const j2 =
|
|
6489
|
+
function dirname(path11) {
|
|
6490
|
+
if (path11 === "/") return "/";
|
|
6491
|
+
const i = path11.lastIndexOf("/");
|
|
6492
|
+
const j = path11.lastIndexOf("\\");
|
|
6493
|
+
const i2 = path11.indexOf("/");
|
|
6494
|
+
const j2 = path11.indexOf("\\");
|
|
6170
6495
|
const idx = i > j ? i : j;
|
|
6171
6496
|
const idx2 = i > j ? i2 : j2;
|
|
6172
|
-
if (idx < 0) return
|
|
6173
|
-
if (idx === idx2) return
|
|
6174
|
-
return
|
|
6497
|
+
if (idx < 0) return path11;
|
|
6498
|
+
if (idx === idx2) return path11.slice(0, idx + 1);
|
|
6499
|
+
return path11.slice(0, idx);
|
|
6175
6500
|
}
|
|
6176
6501
|
function getCurrentLoader(loaderContext, index = loaderContext.loaderIndex) {
|
|
6177
6502
|
var _a;
|
|
@@ -6230,6 +6555,37 @@ async function runLoaders(compiler, context2) {
|
|
|
6230
6555
|
};
|
|
6231
6556
|
loaderContext.importModule = function importModule(request, userOptions, callback) {
|
|
6232
6557
|
const options = userOptions ? userOptions : {};
|
|
6558
|
+
const context3 = this;
|
|
6559
|
+
function finalCallback(onError, onDone) {
|
|
6560
|
+
return function(err, res) {
|
|
6561
|
+
if (err) {
|
|
6562
|
+
onError(err);
|
|
6563
|
+
} else {
|
|
6564
|
+
for (const dep of res.buildDependencies) {
|
|
6565
|
+
context3.addBuildDependency(dep);
|
|
6566
|
+
}
|
|
6567
|
+
for (const dep of res.contextDependencies) {
|
|
6568
|
+
context3.addContextDependency(dep);
|
|
6569
|
+
}
|
|
6570
|
+
for (const dep of res.missingDependencies) {
|
|
6571
|
+
context3.addMissingDependency(dep);
|
|
6572
|
+
}
|
|
6573
|
+
for (const dep of res.fileDependencies) {
|
|
6574
|
+
context3.addDependency(dep);
|
|
6575
|
+
}
|
|
6576
|
+
if (res.cacheable === false) {
|
|
6577
|
+
context3.cacheable(false);
|
|
6578
|
+
}
|
|
6579
|
+
if (res.error) {
|
|
6580
|
+
onError(
|
|
6581
|
+
compiler.__internal__getModuleExecutionResult(res.id) ?? new Error(err)
|
|
6582
|
+
);
|
|
6583
|
+
} else {
|
|
6584
|
+
onDone(compiler.__internal__getModuleExecutionResult(res.id));
|
|
6585
|
+
}
|
|
6586
|
+
}
|
|
6587
|
+
};
|
|
6588
|
+
}
|
|
6233
6589
|
if (!callback) {
|
|
6234
6590
|
return new Promise((resolve2, reject) => {
|
|
6235
6591
|
compiler._lastCompilation.__internal_getInner().importModule(
|
|
@@ -6237,35 +6593,9 @@ async function runLoaders(compiler, context2) {
|
|
|
6237
6593
|
options.layer,
|
|
6238
6594
|
options.publicPath,
|
|
6239
6595
|
options.baseUri,
|
|
6240
|
-
|
|
6596
|
+
context3._module.identifier(),
|
|
6241
6597
|
loaderContext.context,
|
|
6242
|
-
(
|
|
6243
|
-
if (err) reject(err);
|
|
6244
|
-
else {
|
|
6245
|
-
for (const dep of res.buildDependencies) {
|
|
6246
|
-
this.addBuildDependency(dep);
|
|
6247
|
-
}
|
|
6248
|
-
for (const dep of res.contextDependencies) {
|
|
6249
|
-
this.addContextDependency(dep);
|
|
6250
|
-
}
|
|
6251
|
-
for (const dep of res.missingDependencies) {
|
|
6252
|
-
this.addMissingDependency(dep);
|
|
6253
|
-
}
|
|
6254
|
-
for (const dep of res.fileDependencies) {
|
|
6255
|
-
this.addDependency(dep);
|
|
6256
|
-
}
|
|
6257
|
-
if (res.cacheable === false) {
|
|
6258
|
-
this.cacheable(false);
|
|
6259
|
-
}
|
|
6260
|
-
if (res.error) {
|
|
6261
|
-
reject(new Error(res.error));
|
|
6262
|
-
} else {
|
|
6263
|
-
resolve2(
|
|
6264
|
-
compiler.__internal__getModuleExecutionResult(res.id)
|
|
6265
|
-
);
|
|
6266
|
-
}
|
|
6267
|
-
}
|
|
6268
|
-
}
|
|
6598
|
+
finalCallback(reject, resolve2)
|
|
6269
6599
|
);
|
|
6270
6600
|
});
|
|
6271
6601
|
}
|
|
@@ -6274,37 +6604,12 @@ async function runLoaders(compiler, context2) {
|
|
|
6274
6604
|
options.layer,
|
|
6275
6605
|
options.publicPath,
|
|
6276
6606
|
options.baseUri,
|
|
6277
|
-
|
|
6607
|
+
context3._module.identifier(),
|
|
6278
6608
|
loaderContext.context,
|
|
6279
|
-
(
|
|
6280
|
-
|
|
6281
|
-
|
|
6282
|
-
|
|
6283
|
-
for (const dep of res.buildDependencies) {
|
|
6284
|
-
this.addBuildDependency(dep);
|
|
6285
|
-
}
|
|
6286
|
-
for (const dep of res.contextDependencies) {
|
|
6287
|
-
this.addContextDependency(dep);
|
|
6288
|
-
}
|
|
6289
|
-
for (const dep of res.missingDependencies) {
|
|
6290
|
-
this.addMissingDependency(dep);
|
|
6291
|
-
}
|
|
6292
|
-
for (const dep of res.fileDependencies) {
|
|
6293
|
-
this.addDependency(dep);
|
|
6294
|
-
}
|
|
6295
|
-
if (res.cacheable === false) {
|
|
6296
|
-
this.cacheable(false);
|
|
6297
|
-
}
|
|
6298
|
-
if (res.error) {
|
|
6299
|
-
callback(new Error(err), void 0);
|
|
6300
|
-
} else {
|
|
6301
|
-
callback(
|
|
6302
|
-
void 0,
|
|
6303
|
-
compiler.__internal__getModuleExecutionResult(res.id)
|
|
6304
|
-
);
|
|
6305
|
-
}
|
|
6306
|
-
}
|
|
6307
|
-
}
|
|
6609
|
+
finalCallback(
|
|
6610
|
+
(err) => callback(err),
|
|
6611
|
+
(res) => callback(void 0, res)
|
|
6612
|
+
)
|
|
6308
6613
|
);
|
|
6309
6614
|
};
|
|
6310
6615
|
Object.defineProperty(loaderContext, "resource", {
|
|
@@ -6417,7 +6722,7 @@ async function runLoaders(compiler, context2) {
|
|
|
6417
6722
|
error.moduleIdentifier = this._module.identifier();
|
|
6418
6723
|
compiler._lastCompilation.__internal__pushRspackDiagnostic({
|
|
6419
6724
|
error,
|
|
6420
|
-
severity:
|
|
6725
|
+
severity: import_binding27.JsRspackSeverity.Error
|
|
6421
6726
|
});
|
|
6422
6727
|
};
|
|
6423
6728
|
loaderContext.emitWarning = function emitWarning(warn) {
|
|
@@ -6433,7 +6738,7 @@ async function runLoaders(compiler, context2) {
|
|
|
6433
6738
|
warning.moduleIdentifier = this._module.identifier();
|
|
6434
6739
|
compiler._lastCompilation.__internal__pushRspackDiagnostic({
|
|
6435
6740
|
error: warning,
|
|
6436
|
-
severity:
|
|
6741
|
+
severity: import_binding27.JsRspackSeverity.Warn
|
|
6437
6742
|
});
|
|
6438
6743
|
};
|
|
6439
6744
|
loaderContext.emitFile = function emitFile(name2, content, sourceMap, assetInfo) {
|
|
@@ -6474,7 +6779,7 @@ async function runLoaders(compiler, context2) {
|
|
|
6474
6779
|
moduleIdentifier: context2._module.moduleIdentifier
|
|
6475
6780
|
});
|
|
6476
6781
|
compiler._lastCompilation.__internal__pushDiagnostic(
|
|
6477
|
-
(0,
|
|
6782
|
+
(0, import_binding27.formatDiagnostic)(d)
|
|
6478
6783
|
);
|
|
6479
6784
|
}
|
|
6480
6785
|
};
|
|
@@ -6564,7 +6869,7 @@ async function runLoaders(compiler, context2) {
|
|
|
6564
6869
|
});
|
|
6565
6870
|
try {
|
|
6566
6871
|
switch (loaderState) {
|
|
6567
|
-
case
|
|
6872
|
+
case import_binding27.JsLoaderState.Pitching: {
|
|
6568
6873
|
while (loaderContext.loaderIndex < loaderContext.loaders.length) {
|
|
6569
6874
|
const currentLoaderObject = loaderContext.loaders[loaderContext.loaderIndex];
|
|
6570
6875
|
if (currentLoaderObject.shouldYield()) break;
|
|
@@ -6592,7 +6897,7 @@ async function runLoaders(compiler, context2) {
|
|
|
6592
6897
|
}
|
|
6593
6898
|
break;
|
|
6594
6899
|
}
|
|
6595
|
-
case
|
|
6900
|
+
case import_binding27.JsLoaderState.Normal: {
|
|
6596
6901
|
let content = context2.content;
|
|
6597
6902
|
let sourceMap = JsSourceMap.__from_binding(context2.sourceMap);
|
|
6598
6903
|
let additionalData = context2.additionalData;
|
|
@@ -6660,10 +6965,10 @@ function parsePathQueryFragment(str) {
|
|
|
6660
6965
|
|
|
6661
6966
|
// src/config/adapterRuleUse.ts
|
|
6662
6967
|
var BUILTIN_LOADER_PREFIX = "builtin:";
|
|
6663
|
-
function createRawModuleRuleUses(uses,
|
|
6968
|
+
function createRawModuleRuleUses(uses, path11, options) {
|
|
6664
6969
|
const normalizeRuleSetUseItem = (item) => typeof item === "string" ? { loader: item } : item;
|
|
6665
6970
|
const allUses = Array.isArray(uses) ? [...uses].map(normalizeRuleSetUseItem) : [normalizeRuleSetUseItem(uses)];
|
|
6666
|
-
return createRawModuleRuleUsesImpl(allUses,
|
|
6971
|
+
return createRawModuleRuleUsesImpl(allUses, path11, options);
|
|
6667
6972
|
}
|
|
6668
6973
|
var getSwcLoaderOptions = (options, _) => {
|
|
6669
6974
|
if (options && typeof options === "object") {
|
|
@@ -6704,7 +7009,7 @@ function getBuiltinLoaderOptions(identifier, o, options) {
|
|
|
6704
7009
|
}
|
|
6705
7010
|
return o;
|
|
6706
7011
|
}
|
|
6707
|
-
function createRawModuleRuleUsesImpl(uses,
|
|
7012
|
+
function createRawModuleRuleUsesImpl(uses, path11, options) {
|
|
6708
7013
|
if (!uses.length) {
|
|
6709
7014
|
return [];
|
|
6710
7015
|
}
|
|
@@ -6719,7 +7024,7 @@ function createRawModuleRuleUsesImpl(uses, path10, options) {
|
|
|
6719
7024
|
return {
|
|
6720
7025
|
loader: resolveStringifyLoaders(
|
|
6721
7026
|
use,
|
|
6722
|
-
`${
|
|
7027
|
+
`${path11}[${index}]`,
|
|
6723
7028
|
options.compiler,
|
|
6724
7029
|
isBuiltin
|
|
6725
7030
|
),
|
|
@@ -6727,7 +7032,7 @@ function createRawModuleRuleUsesImpl(uses, path10, options) {
|
|
|
6727
7032
|
};
|
|
6728
7033
|
});
|
|
6729
7034
|
}
|
|
6730
|
-
function resolveStringifyLoaders(use,
|
|
7035
|
+
function resolveStringifyLoaders(use, path11, compiler, isBuiltin) {
|
|
6731
7036
|
const obj = parsePathQueryFragment(use.loader);
|
|
6732
7037
|
let ident = null;
|
|
6733
7038
|
if (use.options === null) {
|
|
@@ -6736,7 +7041,7 @@ function resolveStringifyLoaders(use, path10, compiler, isBuiltin) {
|
|
|
6736
7041
|
else if (use.ident) obj.query = `??${ident = use.ident}`;
|
|
6737
7042
|
else if (typeof use.options === "object" && use.options.ident)
|
|
6738
7043
|
obj.query = `??${ident = use.options.ident}`;
|
|
6739
|
-
else if (typeof use.options === "object") obj.query = `??${ident =
|
|
7044
|
+
else if (typeof use.options === "object") obj.query = `??${ident = path11}`;
|
|
6740
7045
|
else obj.query = `?${JSON.stringify(use.options)}`;
|
|
6741
7046
|
if (use.options && typeof use.options === "object") {
|
|
6742
7047
|
if (!ident) ident = "[[missing ident]]";
|
|
@@ -6748,70 +7053,47 @@ function resolveStringifyLoaders(use, path10, compiler, isBuiltin) {
|
|
|
6748
7053
|
return obj.path + obj.query + obj.fragment;
|
|
6749
7054
|
}
|
|
6750
7055
|
function isUseSourceMap(devtool) {
|
|
7056
|
+
if (!devtool) {
|
|
7057
|
+
return false;
|
|
7058
|
+
}
|
|
6751
7059
|
return devtool.includes("source-map") && (devtool.includes("module") || !devtool.includes("cheap"));
|
|
6752
7060
|
}
|
|
6753
7061
|
function isUseSimpleSourceMap(devtool) {
|
|
7062
|
+
if (!devtool) {
|
|
7063
|
+
return false;
|
|
7064
|
+
}
|
|
6754
7065
|
return devtool.includes("source-map") && !isUseSourceMap(devtool);
|
|
6755
7066
|
}
|
|
6756
7067
|
|
|
6757
7068
|
// src/config/adapter.ts
|
|
6758
7069
|
var getRawOptions = (options, compiler) => {
|
|
6759
|
-
(0, import_node_assert3.default)(
|
|
6760
|
-
!isNil(options.context) && !isNil(options.devtool) && !isNil(options.cache),
|
|
6761
|
-
"context, devtool, cache should not be nil after defaults"
|
|
6762
|
-
);
|
|
6763
|
-
const devtool = options.devtool === false ? "" : options.devtool;
|
|
6764
7070
|
const mode2 = options.mode;
|
|
6765
|
-
const experiments3 =
|
|
7071
|
+
const experiments3 = options.experiments;
|
|
6766
7072
|
return {
|
|
6767
7073
|
mode: mode2,
|
|
6768
|
-
target: getRawTarget(options.target),
|
|
6769
7074
|
context: options.context,
|
|
6770
|
-
output:
|
|
7075
|
+
output: options.output,
|
|
6771
7076
|
resolve: getRawResolve(options.resolve),
|
|
6772
7077
|
resolveLoader: getRawResolve(options.resolveLoader),
|
|
6773
7078
|
module: getRawModule(options.module, {
|
|
6774
7079
|
compiler,
|
|
6775
|
-
devtool,
|
|
6776
7080
|
mode: mode2,
|
|
6777
7081
|
context: options.context,
|
|
6778
7082
|
experiments: experiments3
|
|
6779
7083
|
}),
|
|
6780
|
-
|
|
6781
|
-
optimization: getRawOptimization(options.optimization),
|
|
7084
|
+
optimization: options.optimization,
|
|
6782
7085
|
stats: getRawStats(options.stats),
|
|
6783
|
-
snapshot: getRawSnapshotOptions(options.snapshot),
|
|
6784
7086
|
cache: {
|
|
6785
|
-
type: options.cache ? "memory" : "disable"
|
|
6786
|
-
// TODO: implement below cache options
|
|
6787
|
-
maxGenerations: 0,
|
|
6788
|
-
maxAge: 0,
|
|
6789
|
-
profile: false,
|
|
6790
|
-
buildDependencies: [],
|
|
6791
|
-
cacheDirectory: "",
|
|
6792
|
-
cacheLocation: "",
|
|
6793
|
-
name: "",
|
|
6794
|
-
version: ""
|
|
7087
|
+
type: options.cache ? "memory" : "disable"
|
|
6795
7088
|
},
|
|
6796
7089
|
experiments: experiments3,
|
|
6797
7090
|
node: getRawNode(options.node),
|
|
6798
|
-
// SAFETY: applied default value in `applyRspackOptionsDefaults`.
|
|
6799
7091
|
profile: options.profile,
|
|
6800
7092
|
amd: options.amd,
|
|
6801
|
-
// SAFETY: applied default value in `applyRspackOptionsDefaults`.
|
|
6802
7093
|
bail: options.bail,
|
|
6803
7094
|
__references: {}
|
|
6804
7095
|
};
|
|
6805
7096
|
};
|
|
6806
|
-
function getRawTarget(target2) {
|
|
6807
|
-
if (!target2) {
|
|
6808
|
-
return [];
|
|
6809
|
-
}
|
|
6810
|
-
if (typeof target2 === "string") {
|
|
6811
|
-
return [target2];
|
|
6812
|
-
}
|
|
6813
|
-
return target2;
|
|
6814
|
-
}
|
|
6815
7097
|
function getRawExtensionAlias(alias = {}) {
|
|
6816
7098
|
const entries = Object.entries(alias).map(([key, value]) => {
|
|
6817
7099
|
if (Array.isArray(value)) {
|
|
@@ -6851,115 +7133,10 @@ function getRawResolve(resolve2) {
|
|
|
6851
7133
|
...resolve2,
|
|
6852
7134
|
alias: getRawAlias(resolve2.alias),
|
|
6853
7135
|
fallback: getRawAlias(resolve2.fallback),
|
|
6854
|
-
extensionAlias: getRawExtensionAlias(resolve2.extensionAlias),
|
|
6855
|
-
tsconfig: getRawTsConfig(resolve2.tsConfig),
|
|
6856
|
-
byDependency: getRawResolveByDependency(resolve2.byDependency)
|
|
6857
|
-
};
|
|
6858
|
-
}
|
|
6859
|
-
function getRawCrossOriginLoading(crossOriginLoading2) {
|
|
6860
|
-
if (typeof crossOriginLoading2 === "boolean") {
|
|
6861
|
-
return { type: "bool", boolPayload: crossOriginLoading2 };
|
|
6862
|
-
}
|
|
6863
|
-
return { type: "string", stringPayload: crossOriginLoading2 };
|
|
6864
|
-
}
|
|
6865
|
-
function getRawOutput(output2) {
|
|
6866
|
-
const chunkLoading2 = output2.chunkLoading;
|
|
6867
|
-
const wasmLoading2 = output2.wasmLoading;
|
|
6868
|
-
const workerChunkLoading = output2.workerChunkLoading;
|
|
6869
|
-
const workerWasmLoading = output2.workerWasmLoading;
|
|
6870
|
-
return {
|
|
6871
|
-
path: output2.path,
|
|
6872
|
-
pathinfo: output2.pathinfo,
|
|
6873
|
-
publicPath: output2.publicPath,
|
|
6874
|
-
clean: output2.clean,
|
|
6875
|
-
assetModuleFilename: output2.assetModuleFilename,
|
|
6876
|
-
filename: output2.filename,
|
|
6877
|
-
chunkFilename: output2.chunkFilename,
|
|
6878
|
-
chunkLoading: getRawChunkLoading(chunkLoading2),
|
|
6879
|
-
crossOriginLoading: getRawCrossOriginLoading(output2.crossOriginLoading),
|
|
6880
|
-
cssFilename: output2.cssFilename,
|
|
6881
|
-
cssChunkFilename: output2.cssChunkFilename,
|
|
6882
|
-
hotUpdateChunkFilename: output2.hotUpdateChunkFilename,
|
|
6883
|
-
hotUpdateMainFilename: output2.hotUpdateMainFilename,
|
|
6884
|
-
hotUpdateGlobal: output2.hotUpdateGlobal,
|
|
6885
|
-
uniqueName: output2.uniqueName,
|
|
6886
|
-
chunkLoadingGlobal: output2.chunkLoadingGlobal,
|
|
6887
|
-
enabledLibraryTypes: output2.enabledLibraryTypes,
|
|
6888
|
-
library: output2.library && getRawLibrary(output2.library),
|
|
6889
|
-
strictModuleErrorHandling: output2.strictModuleErrorHandling,
|
|
6890
|
-
globalObject: output2.globalObject,
|
|
6891
|
-
importFunctionName: output2.importFunctionName,
|
|
6892
|
-
importMetaName: output2.importMetaName,
|
|
6893
|
-
iife: output2.iife,
|
|
6894
|
-
module: output2.module,
|
|
6895
|
-
wasmLoading: wasmLoading2 === false ? "false" : wasmLoading2,
|
|
6896
|
-
enabledWasmLoadingTypes: output2.enabledWasmLoadingTypes,
|
|
6897
|
-
enabledChunkLoadingTypes: output2.enabledChunkLoadingTypes,
|
|
6898
|
-
webassemblyModuleFilename: output2.webassemblyModuleFilename,
|
|
6899
|
-
trustedTypes: output2.trustedTypes,
|
|
6900
|
-
sourceMapFilename: output2.sourceMapFilename,
|
|
6901
|
-
hashFunction: output2.hashFunction,
|
|
6902
|
-
hashDigest: output2.hashDigest,
|
|
6903
|
-
hashDigestLength: output2.hashDigestLength,
|
|
6904
|
-
hashSalt: output2.hashSalt,
|
|
6905
|
-
asyncChunks: output2.asyncChunks,
|
|
6906
|
-
workerChunkLoading: workerChunkLoading === false ? "false" : workerChunkLoading,
|
|
6907
|
-
workerWasmLoading: workerWasmLoading === false ? "false" : workerWasmLoading,
|
|
6908
|
-
workerPublicPath: output2.workerPublicPath,
|
|
6909
|
-
scriptType: output2.scriptType === false ? "false" : output2.scriptType,
|
|
6910
|
-
charset: output2.charset,
|
|
6911
|
-
chunkLoadTimeout: output2.chunkLoadTimeout,
|
|
6912
|
-
environment: output2.environment,
|
|
6913
|
-
compareBeforeEmit: output2.compareBeforeEmit
|
|
6914
|
-
};
|
|
6915
|
-
}
|
|
6916
|
-
function getRawLibrary(library3) {
|
|
6917
|
-
const {
|
|
6918
|
-
type,
|
|
6919
|
-
name: name2,
|
|
6920
|
-
export: libraryExport2,
|
|
6921
|
-
umdNamedDefine: umdNamedDefine2,
|
|
6922
|
-
auxiliaryComment: auxiliaryComment2,
|
|
6923
|
-
amdContainer: amdContainer2
|
|
6924
|
-
} = library3;
|
|
6925
|
-
return {
|
|
6926
|
-
amdContainer: amdContainer2,
|
|
6927
|
-
auxiliaryComment: typeof auxiliaryComment2 === "string" ? {
|
|
6928
|
-
commonjs: auxiliaryComment2,
|
|
6929
|
-
commonjs2: auxiliaryComment2,
|
|
6930
|
-
amd: auxiliaryComment2,
|
|
6931
|
-
root: auxiliaryComment2
|
|
6932
|
-
} : auxiliaryComment2,
|
|
6933
|
-
libraryType: type,
|
|
6934
|
-
name: isNil(name2) ? name2 : getRawLibraryName(name2),
|
|
6935
|
-
export: Array.isArray(libraryExport2) || libraryExport2 == null ? libraryExport2 : [libraryExport2],
|
|
6936
|
-
umdNamedDefine: umdNamedDefine2
|
|
6937
|
-
};
|
|
6938
|
-
}
|
|
6939
|
-
function getRawLibraryName(name2) {
|
|
6940
|
-
if (typeof name2 === "string") {
|
|
6941
|
-
return {
|
|
6942
|
-
type: "string",
|
|
6943
|
-
stringPayload: name2
|
|
6944
|
-
};
|
|
6945
|
-
}
|
|
6946
|
-
if (Array.isArray(name2)) {
|
|
6947
|
-
return {
|
|
6948
|
-
type: "array",
|
|
6949
|
-
arrayPayload: name2
|
|
6950
|
-
};
|
|
6951
|
-
}
|
|
6952
|
-
if (typeof name2 === "object" && !Array.isArray(name2)) {
|
|
6953
|
-
return {
|
|
6954
|
-
type: "umdObject",
|
|
6955
|
-
umdObjectPayload: {
|
|
6956
|
-
commonjs: name2.commonjs,
|
|
6957
|
-
root: Array.isArray(name2.root) || isNil(name2.root) ? name2.root : [name2.root],
|
|
6958
|
-
amd: name2.amd
|
|
6959
|
-
}
|
|
6960
|
-
};
|
|
6961
|
-
}
|
|
6962
|
-
throw new Error("unreachable");
|
|
7136
|
+
extensionAlias: getRawExtensionAlias(resolve2.extensionAlias),
|
|
7137
|
+
tsconfig: getRawTsConfig(resolve2.tsConfig),
|
|
7138
|
+
byDependency: getRawResolveByDependency(resolve2.byDependency)
|
|
7139
|
+
};
|
|
6963
7140
|
}
|
|
6964
7141
|
function getRawModule(module2, options) {
|
|
6965
7142
|
(0, import_node_assert3.default)(
|
|
@@ -7006,7 +7183,7 @@ function tryMatch(payload, condition) {
|
|
|
7006
7183
|
}
|
|
7007
7184
|
return false;
|
|
7008
7185
|
}
|
|
7009
|
-
var getRawModuleRule = (rule,
|
|
7186
|
+
var getRawModuleRule = (rule, path11, options, upperType) => {
|
|
7010
7187
|
if (rule.loader) {
|
|
7011
7188
|
rule.use = [
|
|
7012
7189
|
{
|
|
@@ -7024,7 +7201,7 @@ var getRawModuleRule = (rule, path10, options, upperType) => {
|
|
|
7024
7201
|
compiler: options.compiler
|
|
7025
7202
|
};
|
|
7026
7203
|
const uses = use(context2);
|
|
7027
|
-
return createRawModuleRuleUses(uses ?? [], `${
|
|
7204
|
+
return createRawModuleRuleUses(uses ?? [], `${path11}.use`, options);
|
|
7028
7205
|
};
|
|
7029
7206
|
}
|
|
7030
7207
|
const rawModuleRule = {
|
|
@@ -7052,7 +7229,7 @@ var getRawModuleRule = (rule, path10, options, upperType) => {
|
|
|
7052
7229
|
scheme: rule.scheme ? getRawRuleSetCondition(rule.scheme) : void 0,
|
|
7053
7230
|
mimetype: rule.mimetype ? getRawRuleSetCondition(rule.mimetype) : void 0,
|
|
7054
7231
|
sideEffects: rule.sideEffects,
|
|
7055
|
-
use: typeof rule.use === "function" ? funcUse : createRawModuleRuleUses(rule.use ?? [], `${
|
|
7232
|
+
use: typeof rule.use === "function" ? funcUse : createRawModuleRuleUses(rule.use ?? [], `${path11}.use`, options),
|
|
7056
7233
|
type: rule.type,
|
|
7057
7234
|
layer: rule.layer,
|
|
7058
7235
|
parser: rule.parser ? getRawParserOptions(rule.parser, rule.type ?? upperType) : void 0,
|
|
@@ -7061,7 +7238,7 @@ var getRawModuleRule = (rule, path10, options, upperType) => {
|
|
|
7061
7238
|
oneOf: rule.oneOf ? rule.oneOf.filter(Boolean).map(
|
|
7062
7239
|
(rule2, index) => getRawModuleRule(
|
|
7063
7240
|
rule2,
|
|
7064
|
-
`${
|
|
7241
|
+
`${path11}.oneOf[${index}]`,
|
|
7065
7242
|
options,
|
|
7066
7243
|
rule2.type ?? upperType
|
|
7067
7244
|
)
|
|
@@ -7069,7 +7246,7 @@ var getRawModuleRule = (rule, path10, options, upperType) => {
|
|
|
7069
7246
|
rules: rule.rules ? rule.rules.filter(Boolean).map(
|
|
7070
7247
|
(rule2, index) => getRawModuleRule(
|
|
7071
7248
|
rule2,
|
|
7072
|
-
`${
|
|
7249
|
+
`${path11}.rules[${index}]`,
|
|
7073
7250
|
options,
|
|
7074
7251
|
rule2.type ?? upperType
|
|
7075
7252
|
)
|
|
@@ -7083,11 +7260,11 @@ var getRawModuleRule = (rule, path10, options, upperType) => {
|
|
|
7083
7260
|
delete rawModuleRule.resourceFragment;
|
|
7084
7261
|
rawModuleRule.rspackResource = getRawRuleSetCondition(
|
|
7085
7262
|
(resourceQueryFragment) => {
|
|
7086
|
-
const { path:
|
|
7087
|
-
if (rule.test && !tryMatch(
|
|
7263
|
+
const { path: path12, query, fragment } = parseResource(resourceQueryFragment);
|
|
7264
|
+
if (rule.test && !tryMatch(path12, rule.test)) {
|
|
7088
7265
|
return false;
|
|
7089
7266
|
}
|
|
7090
|
-
if (rule.resource && !tryMatch(
|
|
7267
|
+
if (rule.resource && !tryMatch(path12, rule.resource)) {
|
|
7091
7268
|
return false;
|
|
7092
7269
|
}
|
|
7093
7270
|
if (rule.resourceQuery && !tryMatch(query, rule.resourceQuery)) {
|
|
@@ -7105,31 +7282,31 @@ var getRawModuleRule = (rule, path10, options, upperType) => {
|
|
|
7105
7282
|
function getRawRuleSetCondition(condition) {
|
|
7106
7283
|
if (typeof condition === "string") {
|
|
7107
7284
|
return {
|
|
7108
|
-
type:
|
|
7285
|
+
type: import_binding28.RawRuleSetConditionType.string,
|
|
7109
7286
|
string: condition
|
|
7110
7287
|
};
|
|
7111
7288
|
}
|
|
7112
7289
|
if (condition instanceof RegExp) {
|
|
7113
7290
|
return {
|
|
7114
|
-
type:
|
|
7291
|
+
type: import_binding28.RawRuleSetConditionType.regexp,
|
|
7115
7292
|
regexp: condition
|
|
7116
7293
|
};
|
|
7117
7294
|
}
|
|
7118
7295
|
if (typeof condition === "function") {
|
|
7119
7296
|
return {
|
|
7120
|
-
type:
|
|
7297
|
+
type: import_binding28.RawRuleSetConditionType.func,
|
|
7121
7298
|
func: condition
|
|
7122
7299
|
};
|
|
7123
7300
|
}
|
|
7124
7301
|
if (Array.isArray(condition)) {
|
|
7125
7302
|
return {
|
|
7126
|
-
type:
|
|
7303
|
+
type: import_binding28.RawRuleSetConditionType.array,
|
|
7127
7304
|
array: condition.map((i) => getRawRuleSetCondition(i))
|
|
7128
7305
|
};
|
|
7129
7306
|
}
|
|
7130
7307
|
if (typeof condition === "object" && condition !== null) {
|
|
7131
7308
|
return {
|
|
7132
|
-
type:
|
|
7309
|
+
type: import_binding28.RawRuleSetConditionType.logical,
|
|
7133
7310
|
logical: [getRawRuleSetLogicalConditions(condition)]
|
|
7134
7311
|
};
|
|
7135
7312
|
}
|
|
@@ -7203,6 +7380,12 @@ function getRawParserOptions(parser, type) {
|
|
|
7203
7380
|
cssModule: getRawCssParserOptions(parser)
|
|
7204
7381
|
};
|
|
7205
7382
|
}
|
|
7383
|
+
if (type === "json") {
|
|
7384
|
+
return {
|
|
7385
|
+
type: "json",
|
|
7386
|
+
json: getRawJsonParserOptions(parser)
|
|
7387
|
+
};
|
|
7388
|
+
}
|
|
7206
7389
|
throw new Error(`unreachable: unknow module type: ${type}`);
|
|
7207
7390
|
}
|
|
7208
7391
|
function getRawJavascriptParserOptions(parser) {
|
|
@@ -7252,6 +7435,11 @@ function getRawCssParserOptions(parser) {
|
|
|
7252
7435
|
namedExports: parser.namedExports
|
|
7253
7436
|
};
|
|
7254
7437
|
}
|
|
7438
|
+
function getRawJsonParserOptions(parser) {
|
|
7439
|
+
return {
|
|
7440
|
+
exportsDepth: parser.exportsDepth
|
|
7441
|
+
};
|
|
7442
|
+
}
|
|
7255
7443
|
function getRawGeneratorOptions(generator, type) {
|
|
7256
7444
|
if (type === "asset") {
|
|
7257
7445
|
return {
|
|
@@ -7314,6 +7502,7 @@ function getRawAssetResourceGeneratorOptions(options) {
|
|
|
7314
7502
|
return {
|
|
7315
7503
|
emit: options.emit,
|
|
7316
7504
|
filename: options.filename,
|
|
7505
|
+
outputPath: options.outputPath,
|
|
7317
7506
|
publicPath: options.publicPath
|
|
7318
7507
|
};
|
|
7319
7508
|
}
|
|
@@ -7326,7 +7515,12 @@ function getRawAssetGeneratorDataUrl(dataUrl) {
|
|
|
7326
7515
|
};
|
|
7327
7516
|
}
|
|
7328
7517
|
if (typeof dataUrl === "function" && dataUrl !== null) {
|
|
7329
|
-
return
|
|
7518
|
+
return (source, context2) => {
|
|
7519
|
+
return dataUrl(source, {
|
|
7520
|
+
...context2,
|
|
7521
|
+
module: Module.__from_binding(context2.module)
|
|
7522
|
+
});
|
|
7523
|
+
};
|
|
7330
7524
|
}
|
|
7331
7525
|
throw new Error(
|
|
7332
7526
|
`unreachable: AssetGeneratorDataUrl type should be one of "options", "function", but got ${dataUrl}`
|
|
@@ -7346,79 +7540,6 @@ function getRawCssAutoOrModuleGeneratorOptions(options) {
|
|
|
7346
7540
|
esModule: options.esModule
|
|
7347
7541
|
};
|
|
7348
7542
|
}
|
|
7349
|
-
function getRawOptimization(optimization2) {
|
|
7350
|
-
(0, import_node_assert3.default)(
|
|
7351
|
-
!isNil(optimization2.removeAvailableModules) && !isNil(optimization2.sideEffects) && !isNil(optimization2.realContentHash) && !isNil(optimization2.providedExports) && !isNil(optimization2.usedExports) && !isNil(optimization2.innerGraph) && "optimization.moduleIds, optimization.removeAvailableModules, optimization.removeEmptyChunks, optimization.sideEffects, optimization.realContentHash, optimization.providedExports, optimization.usedExports, optimization.innerGraph, optimization.concatenateModules should not be nil after defaults"
|
|
7352
|
-
);
|
|
7353
|
-
return {
|
|
7354
|
-
removeAvailableModules: optimization2.removeAvailableModules,
|
|
7355
|
-
sideEffects: String(optimization2.sideEffects),
|
|
7356
|
-
usedExports: String(optimization2.usedExports),
|
|
7357
|
-
providedExports: optimization2.providedExports,
|
|
7358
|
-
innerGraph: optimization2.innerGraph,
|
|
7359
|
-
concatenateModules: !!optimization2.concatenateModules,
|
|
7360
|
-
mangleExports: String(optimization2.mangleExports)
|
|
7361
|
-
};
|
|
7362
|
-
}
|
|
7363
|
-
function getRawSnapshotOptions(_snapshot) {
|
|
7364
|
-
return {};
|
|
7365
|
-
}
|
|
7366
|
-
function getRawExperiments(experiments3) {
|
|
7367
|
-
const { topLevelAwait, layers, incremental: incremental2, rspackFuture, cache } = experiments3;
|
|
7368
|
-
(0, import_node_assert3.default)(
|
|
7369
|
-
!isNil(topLevelAwait) && !isNil(rspackFuture) && !isNil(layers) && !isNil(incremental2)
|
|
7370
|
-
);
|
|
7371
|
-
return {
|
|
7372
|
-
layers,
|
|
7373
|
-
topLevelAwait,
|
|
7374
|
-
cache: getRawExperimentCache(cache),
|
|
7375
|
-
incremental: getRawIncremental(incremental2),
|
|
7376
|
-
rspackFuture: getRawRspackFutureOptions(rspackFuture)
|
|
7377
|
-
};
|
|
7378
|
-
}
|
|
7379
|
-
function getRawExperimentCache(cache) {
|
|
7380
|
-
if (cache === void 0) {
|
|
7381
|
-
throw new Error("experiment cache can not be undefined");
|
|
7382
|
-
}
|
|
7383
|
-
if (typeof cache === "boolean") {
|
|
7384
|
-
return {
|
|
7385
|
-
type: cache ? "memory" : "disable"
|
|
7386
|
-
};
|
|
7387
|
-
}
|
|
7388
|
-
if (cache.type === "persistent") {
|
|
7389
|
-
const { type, snapshot, storage } = cache;
|
|
7390
|
-
return {
|
|
7391
|
-
type,
|
|
7392
|
-
snapshot,
|
|
7393
|
-
storage: [storage]
|
|
7394
|
-
};
|
|
7395
|
-
}
|
|
7396
|
-
return cache;
|
|
7397
|
-
}
|
|
7398
|
-
function getRawIncremental(incremental2) {
|
|
7399
|
-
if (incremental2 === false) {
|
|
7400
|
-
return void 0;
|
|
7401
|
-
}
|
|
7402
|
-
return {
|
|
7403
|
-
make: incremental2.make,
|
|
7404
|
-
inferAsyncModules: incremental2.inferAsyncModules,
|
|
7405
|
-
providedExports: incremental2.providedExports,
|
|
7406
|
-
dependenciesDiagnostics: incremental2.dependenciesDiagnostics,
|
|
7407
|
-
buildChunkGraph: incremental2.buildChunkGraph,
|
|
7408
|
-
moduleIds: incremental2.moduleIds,
|
|
7409
|
-
chunkIds: incremental2.chunkIds,
|
|
7410
|
-
modulesHashes: incremental2.modulesHashes,
|
|
7411
|
-
modulesCodegen: incremental2.modulesCodegen,
|
|
7412
|
-
modulesRuntimeRequirements: incremental2.modulesRuntimeRequirements,
|
|
7413
|
-
chunksRuntimeRequirements: incremental2.chunksRuntimeRequirements,
|
|
7414
|
-
chunksHashes: incremental2.chunksHashes,
|
|
7415
|
-
chunksRender: incremental2.chunksRender,
|
|
7416
|
-
emitAssets: incremental2.emitAssets
|
|
7417
|
-
};
|
|
7418
|
-
}
|
|
7419
|
-
function getRawRspackFutureOptions(future) {
|
|
7420
|
-
return {};
|
|
7421
|
-
}
|
|
7422
7543
|
function getRawNode(node3) {
|
|
7423
7544
|
if (node3 === false) {
|
|
7424
7545
|
return void 0;
|
|
@@ -7438,9 +7559,6 @@ function getRawStats(stats) {
|
|
|
7438
7559
|
colors: statsOptions2.colors ?? false
|
|
7439
7560
|
};
|
|
7440
7561
|
}
|
|
7441
|
-
function getRawChunkLoading(chunkLoading2) {
|
|
7442
|
-
return chunkLoading2 === false ? "false" : chunkLoading2;
|
|
7443
|
-
}
|
|
7444
7562
|
|
|
7445
7563
|
// src/config/defaults.ts
|
|
7446
7564
|
var import_node_assert4 = __toESM(require("assert"));
|
|
@@ -7448,6 +7566,7 @@ var import_node_fs = __toESM(require("fs"));
|
|
|
7448
7566
|
var import_node_path6 = __toESM(require("path"));
|
|
7449
7567
|
|
|
7450
7568
|
// src/ModuleTypeConstants.ts
|
|
7569
|
+
var JSON_MODULE_TYPE = "json";
|
|
7451
7570
|
var ASSET_MODULE_TYPE = "asset";
|
|
7452
7571
|
|
|
7453
7572
|
// src/Template.ts
|
|
@@ -8531,12 +8650,19 @@ var applyRspackOptionsDefaults = (options) => {
|
|
|
8531
8650
|
D(options, "profile", false);
|
|
8532
8651
|
D(options, "bail", false);
|
|
8533
8652
|
F(options, "cache", () => development);
|
|
8534
|
-
applyExperimentsDefaults(options.experiments, {
|
|
8653
|
+
applyExperimentsDefaults(options.experiments, {
|
|
8654
|
+
production,
|
|
8655
|
+
development
|
|
8656
|
+
});
|
|
8657
|
+
if (options.cache === false) {
|
|
8658
|
+
options.experiments.cache = false;
|
|
8659
|
+
}
|
|
8535
8660
|
applySnapshotDefaults(options.snapshot, { production });
|
|
8536
8661
|
applyModuleDefaults(options.module, {
|
|
8537
8662
|
asyncWebAssembly: options.experiments.asyncWebAssembly,
|
|
8538
8663
|
css: options.experiments.css,
|
|
8539
|
-
targetProperties
|
|
8664
|
+
targetProperties,
|
|
8665
|
+
mode: options.mode
|
|
8540
8666
|
});
|
|
8541
8667
|
applyOutputDefaults(options.output, {
|
|
8542
8668
|
context: options.context,
|
|
@@ -8607,8 +8733,8 @@ var applyInfrastructureLoggingDefaults = (infrastructureLogging2) => {
|
|
|
8607
8733
|
D(infrastructureLogging2, "colors", tty);
|
|
8608
8734
|
D(infrastructureLogging2, "appendOnly", !tty);
|
|
8609
8735
|
};
|
|
8610
|
-
var applyExperimentsDefaults = (experiments3, { production }) => {
|
|
8611
|
-
F(experiments3, "cache", () =>
|
|
8736
|
+
var applyExperimentsDefaults = (experiments3, { production, development }) => {
|
|
8737
|
+
F(experiments3, "cache", () => development);
|
|
8612
8738
|
D(experiments3, "futureDefaults", false);
|
|
8613
8739
|
D(experiments3, "lazyCompilation", false);
|
|
8614
8740
|
D(experiments3, "asyncWebAssembly", experiments3.futureDefaults);
|
|
@@ -8621,6 +8747,7 @@ var applyExperimentsDefaults = (experiments3, { production }) => {
|
|
|
8621
8747
|
D(experiments3.incremental, "inferAsyncModules", false);
|
|
8622
8748
|
D(experiments3.incremental, "providedExports", false);
|
|
8623
8749
|
D(experiments3.incremental, "dependenciesDiagnostics", false);
|
|
8750
|
+
D(experiments3.incremental, "sideEffects", false);
|
|
8624
8751
|
D(experiments3.incremental, "buildChunkGraph", false);
|
|
8625
8752
|
D(experiments3.incremental, "moduleIds", false);
|
|
8626
8753
|
D(experiments3.incremental, "chunkIds", false);
|
|
@@ -8669,7 +8796,8 @@ var applyJavascriptParserOptionsDefaults = (parserOptions) => {
|
|
|
8669
8796
|
var applyModuleDefaults = (module2, {
|
|
8670
8797
|
asyncWebAssembly,
|
|
8671
8798
|
css,
|
|
8672
|
-
targetProperties
|
|
8799
|
+
targetProperties,
|
|
8800
|
+
mode: mode2
|
|
8673
8801
|
}) => {
|
|
8674
8802
|
assertNotNill(module2.parser);
|
|
8675
8803
|
assertNotNill(module2.generator);
|
|
@@ -8682,6 +8810,13 @@ var applyModuleDefaults = (module2, {
|
|
|
8682
8810
|
F(module2.parser, "javascript", () => ({}));
|
|
8683
8811
|
assertNotNill(module2.parser.javascript);
|
|
8684
8812
|
applyJavascriptParserOptionsDefaults(module2.parser.javascript);
|
|
8813
|
+
F(module2.parser, JSON_MODULE_TYPE, () => ({}));
|
|
8814
|
+
assertNotNill(module2.parser[JSON_MODULE_TYPE]);
|
|
8815
|
+
D(
|
|
8816
|
+
module2.parser[JSON_MODULE_TYPE],
|
|
8817
|
+
"exportsDepth",
|
|
8818
|
+
mode2 === "development" ? 1 : Number.MAX_SAFE_INTEGER
|
|
8819
|
+
);
|
|
8685
8820
|
if (css) {
|
|
8686
8821
|
F(module2.parser, "css", () => ({}));
|
|
8687
8822
|
assertNotNill(module2.parser.css);
|
|
@@ -9230,6 +9365,7 @@ var applyOptimizationDefaults = (optimization2, {
|
|
|
9230
9365
|
D(optimization2, "emitOnErrors", !production);
|
|
9231
9366
|
D(optimization2, "runtimeChunk", false);
|
|
9232
9367
|
D(optimization2, "realContentHash", production);
|
|
9368
|
+
D(optimization2, "avoidEntryIife", false);
|
|
9233
9369
|
D(optimization2, "minimize", production);
|
|
9234
9370
|
D(optimization2, "concatenateModules", production);
|
|
9235
9371
|
A(optimization2, "minimizer", () => [
|
|
@@ -9406,6 +9542,7 @@ var A = (obj, prop, factory) => {
|
|
|
9406
9542
|
};
|
|
9407
9543
|
|
|
9408
9544
|
// src/config/normalization.ts
|
|
9545
|
+
var import_node_path7 = __toESM(require("path"));
|
|
9409
9546
|
var import_node_util4 = __toESM(require("util"));
|
|
9410
9547
|
var getNormalizedRspackOptions = (config2) => {
|
|
9411
9548
|
return {
|
|
@@ -9582,7 +9719,38 @@ var getNormalizedRspackOptions = (config2) => {
|
|
|
9582
9719
|
plugins: nestedArray(config2.plugins, (p) => [...p]),
|
|
9583
9720
|
experiments: nestedConfig(config2.experiments, (experiments3) => ({
|
|
9584
9721
|
...experiments3,
|
|
9585
|
-
cache: experiments3.cache,
|
|
9722
|
+
cache: optionalNestedConfig(experiments3.cache, (cache) => {
|
|
9723
|
+
var _a;
|
|
9724
|
+
if (typeof cache === "boolean") {
|
|
9725
|
+
return cache;
|
|
9726
|
+
}
|
|
9727
|
+
if (cache.type === "memory") {
|
|
9728
|
+
return cache;
|
|
9729
|
+
}
|
|
9730
|
+
const snapshot = cache.snapshot || {};
|
|
9731
|
+
return {
|
|
9732
|
+
type: "persistent",
|
|
9733
|
+
buildDependencies: nestedArray(
|
|
9734
|
+
cache.buildDependencies,
|
|
9735
|
+
(deps) => deps.map((d) => import_node_path7.default.resolve(config2.context || process.cwd(), d))
|
|
9736
|
+
),
|
|
9737
|
+
version: cache.version || "",
|
|
9738
|
+
snapshot: {
|
|
9739
|
+
immutablePaths: nestedArray(snapshot.immutablePaths, (p) => [...p]),
|
|
9740
|
+
unmanagedPaths: nestedArray(snapshot.unmanagedPaths, (p) => [...p]),
|
|
9741
|
+
managedPaths: optionalNestedArray(snapshot.managedPaths, (p) => [
|
|
9742
|
+
...p
|
|
9743
|
+
]) || [/\/node_modules\//]
|
|
9744
|
+
},
|
|
9745
|
+
storage: {
|
|
9746
|
+
type: "filesystem",
|
|
9747
|
+
directory: import_node_path7.default.resolve(
|
|
9748
|
+
config2.context || process.cwd(),
|
|
9749
|
+
((_a = cache.storage) == null ? void 0 : _a.directory) || "node_modules/.cache/rspack"
|
|
9750
|
+
)
|
|
9751
|
+
}
|
|
9752
|
+
};
|
|
9753
|
+
}),
|
|
9586
9754
|
lazyCompilation: optionalNestedConfig(
|
|
9587
9755
|
experiments3.lazyCompilation,
|
|
9588
9756
|
(options) => options === true ? {} : options
|
|
@@ -9591,9 +9759,10 @@ var getNormalizedRspackOptions = (config2) => {
|
|
|
9591
9759
|
experiments3.incremental,
|
|
9592
9760
|
(options) => options === true ? {
|
|
9593
9761
|
make: true,
|
|
9594
|
-
dependenciesDiagnostics: true,
|
|
9595
9762
|
inferAsyncModules: true,
|
|
9596
9763
|
providedExports: true,
|
|
9764
|
+
dependenciesDiagnostics: true,
|
|
9765
|
+
sideEffects: true,
|
|
9597
9766
|
buildChunkGraph: true,
|
|
9598
9767
|
moduleIds: true,
|
|
9599
9768
|
chunkIds: true,
|
|
@@ -9704,7 +9873,7 @@ var keyedNestedConfig = (value, fn2, customKeys) => {
|
|
|
9704
9873
|
};
|
|
9705
9874
|
|
|
9706
9875
|
// src/config/zod.ts
|
|
9707
|
-
var
|
|
9876
|
+
var import_node_path8 = __toESM(require("path"));
|
|
9708
9877
|
var import_zod2 = require("../compiled/zod/index.js");
|
|
9709
9878
|
|
|
9710
9879
|
// src/config/utils.ts
|
|
@@ -9862,7 +10031,7 @@ var filename = filenameTemplate.or(
|
|
|
9862
10031
|
var name = import_zod2.z.string();
|
|
9863
10032
|
var dependencies = import_zod2.z.array(name);
|
|
9864
10033
|
var context = import_zod2.z.string().refine(
|
|
9865
|
-
(val) =>
|
|
10034
|
+
(val) => import_node_path8.default.isAbsolute(val),
|
|
9866
10035
|
(val) => ({
|
|
9867
10036
|
message: `The provided value ${JSON.stringify(val)} must be an absolute path.`
|
|
9868
10037
|
})
|
|
@@ -9961,7 +10130,7 @@ var entryDynamic = import_zod2.z.function().returns(
|
|
|
9961
10130
|
entryStatic.or(import_zod2.z.promise(entryStatic))
|
|
9962
10131
|
);
|
|
9963
10132
|
var entry = entryStatic.or(entryDynamic);
|
|
9964
|
-
var
|
|
10133
|
+
var path7 = import_zod2.z.string();
|
|
9965
10134
|
var pathinfo = import_zod2.z.boolean().or(import_zod2.z.literal("verbose"));
|
|
9966
10135
|
var assetModuleFilename = filename;
|
|
9967
10136
|
var webassemblyModuleFilename = import_zod2.z.string();
|
|
@@ -10035,7 +10204,7 @@ var environment = import_zod2.z.strictObject({
|
|
|
10035
10204
|
templateLiteral: import_zod2.z.boolean().optional()
|
|
10036
10205
|
});
|
|
10037
10206
|
var output = import_zod2.z.strictObject({
|
|
10038
|
-
path:
|
|
10207
|
+
path: path7.optional(),
|
|
10039
10208
|
pathinfo: pathinfo.optional(),
|
|
10040
10209
|
clean: clean.optional(),
|
|
10041
10210
|
publicPath: publicPath.optional(),
|
|
@@ -10258,9 +10427,10 @@ var assetGeneratorDataUrlOptions = import_zod2.z.strictObject({
|
|
|
10258
10427
|
mimetype: import_zod2.z.string().optional()
|
|
10259
10428
|
});
|
|
10260
10429
|
var assetGeneratorDataUrlFunction = import_zod2.z.function().args(
|
|
10430
|
+
import_zod2.z.instanceof(Buffer),
|
|
10261
10431
|
import_zod2.z.strictObject({
|
|
10262
|
-
|
|
10263
|
-
|
|
10432
|
+
filename: import_zod2.z.string(),
|
|
10433
|
+
module: import_zod2.z.custom()
|
|
10264
10434
|
})
|
|
10265
10435
|
).returns(import_zod2.z.string());
|
|
10266
10436
|
var assetGeneratorDataUrl = assetGeneratorDataUrlOptions.or(
|
|
@@ -10702,7 +10872,7 @@ var optimizationSplitChunksCacheGroup = import_zod2.z.strictObject({
|
|
|
10702
10872
|
).optional(),
|
|
10703
10873
|
priority: import_zod2.z.number().optional(),
|
|
10704
10874
|
enforce: import_zod2.z.boolean().optional(),
|
|
10705
|
-
filename:
|
|
10875
|
+
filename: filename.optional(),
|
|
10706
10876
|
reuseExistingChunk: import_zod2.z.boolean().optional(),
|
|
10707
10877
|
type: import_zod2.z.string().or(import_zod2.z.instanceof(RegExp)).optional(),
|
|
10708
10878
|
idHint: import_zod2.z.string().optional(),
|
|
@@ -10723,7 +10893,7 @@ var optimizationSplitChunksOptions = import_zod2.z.strictObject({
|
|
|
10723
10893
|
});
|
|
10724
10894
|
var optimization = import_zod2.z.strictObject({
|
|
10725
10895
|
moduleIds: import_zod2.z.enum(["named", "natural", "deterministic"]).optional(),
|
|
10726
|
-
chunkIds: import_zod2.z.enum(["natural", "named", "deterministic"]).optional(),
|
|
10896
|
+
chunkIds: import_zod2.z.enum(["natural", "named", "deterministic", "size", "total-size"]).optional(),
|
|
10727
10897
|
minimize: import_zod2.z.boolean().optional(),
|
|
10728
10898
|
minimizer: import_zod2.z.literal("...").or(plugin).array().optional(),
|
|
10729
10899
|
mergeDuplicateChunks: import_zod2.z.boolean().optional(),
|
|
@@ -10739,7 +10909,8 @@ var optimization = import_zod2.z.strictObject({
|
|
|
10739
10909
|
usedExports: import_zod2.z.enum(["global"]).or(import_zod2.z.boolean()).optional(),
|
|
10740
10910
|
mangleExports: import_zod2.z.enum(["size", "deterministic"]).or(import_zod2.z.boolean()).optional(),
|
|
10741
10911
|
nodeEnv: import_zod2.z.union([import_zod2.z.string(), import_zod2.z.literal(false)]).optional(),
|
|
10742
|
-
emitOnErrors: import_zod2.z.boolean().optional()
|
|
10912
|
+
emitOnErrors: import_zod2.z.boolean().optional(),
|
|
10913
|
+
avoidEntryIife: import_zod2.z.boolean().optional()
|
|
10743
10914
|
});
|
|
10744
10915
|
var rspackFutureOptions = import_zod2.z.strictObject({
|
|
10745
10916
|
bundlerInfo: import_zod2.z.strictObject({
|
|
@@ -10763,15 +10934,17 @@ var experimentCacheOptions = import_zod2.z.object({
|
|
|
10763
10934
|
}).or(
|
|
10764
10935
|
import_zod2.z.object({
|
|
10765
10936
|
type: import_zod2.z.enum(["persistent"]),
|
|
10766
|
-
|
|
10767
|
-
|
|
10768
|
-
|
|
10769
|
-
|
|
10770
|
-
|
|
10771
|
-
|
|
10937
|
+
buildDependencies: import_zod2.z.string().array().optional(),
|
|
10938
|
+
version: import_zod2.z.string().optional(),
|
|
10939
|
+
snapshot: import_zod2.z.object({
|
|
10940
|
+
immutablePaths: import_zod2.z.string().or(import_zod2.z.instanceof(RegExp)).array().optional(),
|
|
10941
|
+
unmanagedPaths: import_zod2.z.string().or(import_zod2.z.instanceof(RegExp)).array().optional(),
|
|
10942
|
+
managedPaths: import_zod2.z.string().or(import_zod2.z.instanceof(RegExp)).array().optional()
|
|
10943
|
+
}).optional(),
|
|
10944
|
+
storage: import_zod2.z.object({
|
|
10772
10945
|
type: import_zod2.z.enum(["filesystem"]),
|
|
10773
|
-
directory: import_zod2.z.string()
|
|
10774
|
-
})
|
|
10946
|
+
directory: import_zod2.z.string().optional()
|
|
10947
|
+
}).optional()
|
|
10775
10948
|
})
|
|
10776
10949
|
);
|
|
10777
10950
|
var lazyCompilationOptions = import_zod2.z.object({
|
|
@@ -10789,6 +10962,7 @@ var incremental = import_zod2.z.strictObject({
|
|
|
10789
10962
|
inferAsyncModules: import_zod2.z.boolean().optional(),
|
|
10790
10963
|
providedExports: import_zod2.z.boolean().optional(),
|
|
10791
10964
|
dependenciesDiagnostics: import_zod2.z.boolean().optional(),
|
|
10965
|
+
sideEffects: import_zod2.z.boolean().optional(),
|
|
10792
10966
|
buildChunkGraph: import_zod2.z.boolean().optional(),
|
|
10793
10967
|
moduleIds: import_zod2.z.boolean().optional(),
|
|
10794
10968
|
chunkIds: import_zod2.z.boolean().optional(),
|
|
@@ -10821,206 +10995,51 @@ var watchOptions = import_zod2.z.strictObject({
|
|
|
10821
10995
|
stdin: import_zod2.z.boolean().optional()
|
|
10822
10996
|
});
|
|
10823
10997
|
var devServer = import_zod2.z.custom();
|
|
10824
|
-
var ignoreWarnings = import_zod2.z.instanceof(RegExp).or(
|
|
10825
|
-
import_zod2.z.function().args(import_zod2.z.instanceof(Error), import_zod2.z.custom()).returns(import_zod2.z.boolean())
|
|
10826
|
-
).array();
|
|
10827
|
-
var profile = import_zod2.z.boolean();
|
|
10828
|
-
var amd = import_zod2.z.literal(false).or(import_zod2.z.record(import_zod2.z.any()));
|
|
10829
|
-
var bail = import_zod2.z.boolean();
|
|
10830
|
-
var performance = import_zod2.z.strictObject({
|
|
10831
|
-
assetFilter: import_zod2.z.function().args(import_zod2.z.string()).returns(import_zod2.z.boolean()).optional(),
|
|
10832
|
-
hints: import_zod2.z.enum(["error", "warning"]).or(import_zod2.z.literal(false)).optional(),
|
|
10833
|
-
maxAssetSize: import_zod2.z.number().optional(),
|
|
10834
|
-
maxEntrypointSize: import_zod2.z.number().optional()
|
|
10835
|
-
}).or(import_zod2.z.literal(false));
|
|
10836
|
-
var rspackOptions = import_zod2.z.strictObject({
|
|
10837
|
-
name: name.optional(),
|
|
10838
|
-
dependencies: dependencies.optional(),
|
|
10839
|
-
entry: entry.optional(),
|
|
10840
|
-
output: output.optional(),
|
|
10841
|
-
target: target.optional(),
|
|
10842
|
-
mode: mode.optional(),
|
|
10843
|
-
experiments: experiments.optional(),
|
|
10844
|
-
externals: externals.optional(),
|
|
10845
|
-
externalsType: externalsType.optional(),
|
|
10846
|
-
externalsPresets: externalsPresets.optional(),
|
|
10847
|
-
infrastructureLogging: infrastructureLogging.optional(),
|
|
10848
|
-
cache: cacheOptions.optional(),
|
|
10849
|
-
context: context.optional(),
|
|
10850
|
-
devtool: devTool.optional(),
|
|
10851
|
-
node: node.optional(),
|
|
10852
|
-
loader: loader.optional(),
|
|
10853
|
-
ignoreWarnings: ignoreWarnings.optional(),
|
|
10854
|
-
watchOptions: watchOptions.optional(),
|
|
10855
|
-
watch: watch.optional(),
|
|
10856
|
-
stats: statsValue.optional(),
|
|
10857
|
-
snapshot: snapshotOptions.optional(),
|
|
10858
|
-
optimization: optimization.optional(),
|
|
10859
|
-
resolve: resolveOptions.optional(),
|
|
10860
|
-
resolveLoader: resolveOptions.optional(),
|
|
10861
|
-
plugins: plugins.optional(),
|
|
10862
|
-
devServer: devServer.optional(),
|
|
10863
|
-
module: moduleOptions.optional(),
|
|
10864
|
-
profile: profile.optional(),
|
|
10865
|
-
amd: amd.optional(),
|
|
10866
|
-
bail: bail.optional(),
|
|
10867
|
-
performance: performance.optional()
|
|
10868
|
-
});
|
|
10869
|
-
|
|
10870
|
-
// src/builtin-plugin/EntryPlugin.ts
|
|
10871
|
-
var EntryPlugin = create2(
|
|
10872
|
-
import_binding24.BuiltinPluginName.EntryPlugin,
|
|
10873
|
-
(context2, entry2, options = "") => {
|
|
10874
|
-
const entryOptions = typeof options === "string" ? { name: options } : options;
|
|
10875
|
-
return {
|
|
10876
|
-
context: context2,
|
|
10877
|
-
entry: entry2,
|
|
10878
|
-
options: getRawEntryOptions(entryOptions)
|
|
10879
|
-
};
|
|
10880
|
-
},
|
|
10881
|
-
"make"
|
|
10882
|
-
);
|
|
10883
|
-
function getRawEntryOptions(entry2) {
|
|
10884
|
-
const runtime = entry2.runtime;
|
|
10885
|
-
const chunkLoading2 = entry2.chunkLoading;
|
|
10886
|
-
return {
|
|
10887
|
-
name: entry2.name,
|
|
10888
|
-
publicPath: entry2.publicPath,
|
|
10889
|
-
baseUri: entry2.baseUri,
|
|
10890
|
-
runtime,
|
|
10891
|
-
chunkLoading: !isNil(chunkLoading2) ? getRawChunkLoading(chunkLoading2) : void 0,
|
|
10892
|
-
asyncChunks: entry2.asyncChunks,
|
|
10893
|
-
filename: entry2.filename,
|
|
10894
|
-
library: entry2.library && getRawLibrary(entry2.library),
|
|
10895
|
-
layer: entry2.layer ?? void 0,
|
|
10896
|
-
dependOn: entry2.dependOn
|
|
10897
|
-
};
|
|
10898
|
-
}
|
|
10899
|
-
|
|
10900
|
-
// src/builtin-plugin/DynamicEntryPlugin.ts
|
|
10901
|
-
var DynamicEntryPlugin = class extends RspackBuiltinPlugin {
|
|
10902
|
-
constructor(context2, entry2) {
|
|
10903
|
-
super();
|
|
10904
|
-
this.context = context2;
|
|
10905
|
-
this.entry = entry2;
|
|
10906
|
-
this.name = import_binding25.BuiltinPluginName.DynamicEntryPlugin;
|
|
10907
|
-
this.affectedHooks = "make";
|
|
10908
|
-
}
|
|
10909
|
-
raw(compiler) {
|
|
10910
|
-
const raw = {
|
|
10911
|
-
context: this.context,
|
|
10912
|
-
entry: async () => {
|
|
10913
|
-
const result2 = await this.entry();
|
|
10914
|
-
return Object.entries(result2).map(([name2, desc]) => {
|
|
10915
|
-
const options = EntryOptionPlugin_default.entryDescriptionToOptions(
|
|
10916
|
-
compiler,
|
|
10917
|
-
name2,
|
|
10918
|
-
desc
|
|
10919
|
-
);
|
|
10920
|
-
return {
|
|
10921
|
-
import: desc.import,
|
|
10922
|
-
options: getRawEntryOptions(options)
|
|
10923
|
-
};
|
|
10924
|
-
});
|
|
10925
|
-
}
|
|
10926
|
-
};
|
|
10927
|
-
return createBuiltinPlugin(this.name, raw);
|
|
10928
|
-
}
|
|
10929
|
-
};
|
|
10930
|
-
|
|
10931
|
-
// src/builtin-plugin/ElectronTargetPlugin.ts
|
|
10932
|
-
var import_binding26 = require("@rspack/binding");
|
|
10933
|
-
var ElectronTargetPlugin = create2(
|
|
10934
|
-
import_binding26.BuiltinPluginName.ElectronTargetPlugin,
|
|
10935
|
-
(context2) => context2 ?? "none"
|
|
10936
|
-
);
|
|
10937
|
-
|
|
10938
|
-
// src/builtin-plugin/EnableChunkLoadingPlugin.ts
|
|
10939
|
-
var import_binding27 = require("@rspack/binding");
|
|
10940
|
-
var EnableChunkLoadingPlugin = create2(
|
|
10941
|
-
import_binding27.BuiltinPluginName.EnableChunkLoadingPlugin,
|
|
10942
|
-
(type) => type
|
|
10943
|
-
);
|
|
10944
|
-
|
|
10945
|
-
// src/builtin-plugin/EnableLibraryPlugin.ts
|
|
10946
|
-
var import_binding28 = require("@rspack/binding");
|
|
10947
|
-
var enabledTypes = /* @__PURE__ */ new WeakMap();
|
|
10948
|
-
var getEnabledTypes = (compiler) => {
|
|
10949
|
-
let set = enabledTypes.get(compiler);
|
|
10950
|
-
if (set === void 0) {
|
|
10951
|
-
set = /* @__PURE__ */ new Set();
|
|
10952
|
-
enabledTypes.set(compiler, set);
|
|
10953
|
-
}
|
|
10954
|
-
return set;
|
|
10955
|
-
};
|
|
10956
|
-
var EnableLibraryPlugin = class extends RspackBuiltinPlugin {
|
|
10957
|
-
constructor(type) {
|
|
10958
|
-
super();
|
|
10959
|
-
this.type = type;
|
|
10960
|
-
this.name = import_binding28.BuiltinPluginName.EnableLibraryPlugin;
|
|
10961
|
-
}
|
|
10962
|
-
static setEnabled(compiler, type) {
|
|
10963
|
-
getEnabledTypes(compiler).add(type);
|
|
10964
|
-
}
|
|
10965
|
-
static checkEnabled(compiler, type) {
|
|
10966
|
-
if (!getEnabledTypes(compiler).has(type)) {
|
|
10967
|
-
throw new Error(
|
|
10968
|
-
`Library type "${type}" is not enabled. EnableLibraryPlugin need to be used to enable this type of library. This usually happens through the "output.enabledLibraryTypes" option. If you are using a function as entry which sets "library", you need to add all potential library types to "output.enabledLibraryTypes". These types are enabled: ${Array.from(getEnabledTypes(compiler)).join(", ")}`
|
|
10969
|
-
);
|
|
10970
|
-
}
|
|
10971
|
-
}
|
|
10972
|
-
raw(compiler) {
|
|
10973
|
-
const { type } = this;
|
|
10974
|
-
const enabled = getEnabledTypes(compiler);
|
|
10975
|
-
if (enabled.has(type)) return;
|
|
10976
|
-
enabled.add(type);
|
|
10977
|
-
return createBuiltinPlugin(this.name, type);
|
|
10978
|
-
}
|
|
10979
|
-
};
|
|
10980
|
-
|
|
10981
|
-
// src/builtin-plugin/EnableWasmLoadingPlugin.ts
|
|
10982
|
-
var import_binding29 = require("@rspack/binding");
|
|
10983
|
-
var EnableWasmLoadingPlugin = create2(
|
|
10984
|
-
import_binding29.BuiltinPluginName.EnableWasmLoadingPlugin,
|
|
10985
|
-
(type) => type
|
|
10986
|
-
);
|
|
10987
|
-
|
|
10988
|
-
// src/builtin-plugin/EnsureChunkConditionsPlugin.ts
|
|
10989
|
-
var import_binding30 = require("@rspack/binding");
|
|
10990
|
-
var EnsureChunkConditionsPlugin = create2(
|
|
10991
|
-
import_binding30.BuiltinPluginName.EnsureChunkConditionsPlugin,
|
|
10992
|
-
() => {
|
|
10993
|
-
}
|
|
10994
|
-
);
|
|
10995
|
-
|
|
10996
|
-
// src/builtin-plugin/EvalDevToolModulePlugin.ts
|
|
10997
|
-
var import_binding31 = require("@rspack/binding");
|
|
10998
|
-
var EvalDevToolModulePlugin = create2(
|
|
10999
|
-
import_binding31.BuiltinPluginName.EvalDevToolModulePlugin,
|
|
11000
|
-
(options) => options,
|
|
11001
|
-
"compilation"
|
|
11002
|
-
);
|
|
11003
|
-
|
|
11004
|
-
// src/builtin-plugin/EvalSourceMapDevToolPlugin.ts
|
|
11005
|
-
var import_binding32 = require("@rspack/binding");
|
|
11006
|
-
var EvalSourceMapDevToolPlugin = create2(
|
|
11007
|
-
import_binding32.BuiltinPluginName.EvalSourceMapDevToolPlugin,
|
|
11008
|
-
(options) => {
|
|
11009
|
-
return {
|
|
11010
|
-
filename: options.filename || void 0,
|
|
11011
|
-
append: options.append,
|
|
11012
|
-
namespace: options.namespace ?? "",
|
|
11013
|
-
columns: options.columns ?? true,
|
|
11014
|
-
noSources: options.noSources ?? false,
|
|
11015
|
-
publicPath: options.publicPath,
|
|
11016
|
-
module: options.module
|
|
11017
|
-
};
|
|
11018
|
-
},
|
|
11019
|
-
"compilation"
|
|
11020
|
-
);
|
|
11021
|
-
|
|
11022
|
-
// src/builtin-plugin/ExternalsPlugin.ts
|
|
11023
|
-
var import_binding33 = require("@rspack/binding");
|
|
10998
|
+
var ignoreWarnings = import_zod2.z.instanceof(RegExp).or(
|
|
10999
|
+
import_zod2.z.function().args(import_zod2.z.instanceof(Error), import_zod2.z.custom()).returns(import_zod2.z.boolean())
|
|
11000
|
+
).array();
|
|
11001
|
+
var profile = import_zod2.z.boolean();
|
|
11002
|
+
var amd = import_zod2.z.literal(false).or(import_zod2.z.record(import_zod2.z.any()));
|
|
11003
|
+
var bail = import_zod2.z.boolean();
|
|
11004
|
+
var performance = import_zod2.z.strictObject({
|
|
11005
|
+
assetFilter: import_zod2.z.function().args(import_zod2.z.string()).returns(import_zod2.z.boolean()).optional(),
|
|
11006
|
+
hints: import_zod2.z.enum(["error", "warning"]).or(import_zod2.z.literal(false)).optional(),
|
|
11007
|
+
maxAssetSize: import_zod2.z.number().optional(),
|
|
11008
|
+
maxEntrypointSize: import_zod2.z.number().optional()
|
|
11009
|
+
}).or(import_zod2.z.literal(false));
|
|
11010
|
+
var rspackOptions = import_zod2.z.strictObject({
|
|
11011
|
+
name: name.optional(),
|
|
11012
|
+
dependencies: dependencies.optional(),
|
|
11013
|
+
entry: entry.optional(),
|
|
11014
|
+
output: output.optional(),
|
|
11015
|
+
target: target.optional(),
|
|
11016
|
+
mode: mode.optional(),
|
|
11017
|
+
experiments: experiments.optional(),
|
|
11018
|
+
externals: externals.optional(),
|
|
11019
|
+
externalsType: externalsType.optional(),
|
|
11020
|
+
externalsPresets: externalsPresets.optional(),
|
|
11021
|
+
infrastructureLogging: infrastructureLogging.optional(),
|
|
11022
|
+
cache: cacheOptions.optional(),
|
|
11023
|
+
context: context.optional(),
|
|
11024
|
+
devtool: devTool.optional(),
|
|
11025
|
+
node: node.optional(),
|
|
11026
|
+
loader: loader.optional(),
|
|
11027
|
+
ignoreWarnings: ignoreWarnings.optional(),
|
|
11028
|
+
watchOptions: watchOptions.optional(),
|
|
11029
|
+
watch: watch.optional(),
|
|
11030
|
+
stats: statsValue.optional(),
|
|
11031
|
+
snapshot: snapshotOptions.optional(),
|
|
11032
|
+
optimization: optimization.optional(),
|
|
11033
|
+
resolve: resolveOptions.optional(),
|
|
11034
|
+
resolveLoader: resolveOptions.optional(),
|
|
11035
|
+
plugins: plugins.optional(),
|
|
11036
|
+
devServer: devServer.optional(),
|
|
11037
|
+
module: moduleOptions.optional(),
|
|
11038
|
+
profile: profile.optional(),
|
|
11039
|
+
amd: amd.optional(),
|
|
11040
|
+
bail: bail.optional(),
|
|
11041
|
+
performance: performance.optional()
|
|
11042
|
+
});
|
|
11024
11043
|
|
|
11025
11044
|
// src/Resolver.ts
|
|
11026
11045
|
function isString(value) {
|
|
@@ -11030,12 +11049,12 @@ var Resolver = class _Resolver {
|
|
|
11030
11049
|
constructor(binding3) {
|
|
11031
11050
|
this.binding = binding3;
|
|
11032
11051
|
}
|
|
11033
|
-
resolveSync(context2,
|
|
11034
|
-
return this.binding.resolveSync(
|
|
11052
|
+
resolveSync(context2, path11, request) {
|
|
11053
|
+
return this.binding.resolveSync(path11, request);
|
|
11035
11054
|
}
|
|
11036
|
-
resolve(context2,
|
|
11055
|
+
resolve(context2, path11, request, resolveContext, callback) {
|
|
11037
11056
|
try {
|
|
11038
|
-
const res = this.binding.resolveSync(
|
|
11057
|
+
const res = this.binding.resolveSync(path11, request);
|
|
11039
11058
|
callback(null, res);
|
|
11040
11059
|
} catch (err) {
|
|
11041
11060
|
callback(err);
|
|
@@ -11065,7 +11084,7 @@ var ExternalsPlugin = class extends RspackBuiltinPlugin {
|
|
|
11065
11084
|
super();
|
|
11066
11085
|
this.type = type;
|
|
11067
11086
|
this.externals = externals2;
|
|
11068
|
-
this.name =
|
|
11087
|
+
this.name = import_binding29.BuiltinPluginName.ExternalsPlugin;
|
|
11069
11088
|
}
|
|
11070
11089
|
raw(compiler) {
|
|
11071
11090
|
const { type, externals: externals2 } = this;
|
|
@@ -11173,30 +11192,30 @@ function getRawExternalItemValue(value) {
|
|
|
11173
11192
|
}
|
|
11174
11193
|
|
|
11175
11194
|
// src/builtin-plugin/FileUriPlugin.ts
|
|
11176
|
-
var
|
|
11195
|
+
var import_binding30 = require("@rspack/binding");
|
|
11177
11196
|
var FileUriPlugin = create2(
|
|
11178
|
-
|
|
11197
|
+
import_binding30.BuiltinPluginName.FileUriPlugin,
|
|
11179
11198
|
() => {
|
|
11180
11199
|
},
|
|
11181
11200
|
"compilation"
|
|
11182
11201
|
);
|
|
11183
11202
|
|
|
11184
11203
|
// src/builtin-plugin/FlagDependencyExportsPlugin.ts
|
|
11185
|
-
var
|
|
11204
|
+
var import_binding31 = require("@rspack/binding");
|
|
11186
11205
|
var FlagDependencyExportsPlugin = create2(
|
|
11187
|
-
|
|
11206
|
+
import_binding31.BuiltinPluginName.FlagDependencyExportsPlugin,
|
|
11188
11207
|
() => {
|
|
11189
11208
|
},
|
|
11190
11209
|
"compilation"
|
|
11191
11210
|
);
|
|
11192
11211
|
|
|
11193
11212
|
// src/builtin-plugin/FlagDependencyUsagePlugin.ts
|
|
11194
|
-
var
|
|
11213
|
+
var import_binding32 = require("@rspack/binding");
|
|
11195
11214
|
var FlagDependencyUsagePlugin = class extends RspackBuiltinPlugin {
|
|
11196
11215
|
constructor(global) {
|
|
11197
11216
|
super();
|
|
11198
11217
|
this.global = global;
|
|
11199
|
-
this.name =
|
|
11218
|
+
this.name = import_binding32.BuiltinPluginName.FlagDependencyUsagePlugin;
|
|
11200
11219
|
this.affectedHooks = "compilation";
|
|
11201
11220
|
}
|
|
11202
11221
|
raw(compiler) {
|
|
@@ -11207,19 +11226,19 @@ var FlagDependencyUsagePlugin = class extends RspackBuiltinPlugin {
|
|
|
11207
11226
|
if (incremental2.modulesHashes) {
|
|
11208
11227
|
incremental2.modulesHashes = false;
|
|
11209
11228
|
logger.warn(
|
|
11210
|
-
"`optimization.usedExports` can't be used with `incremental.modulesHashes` as export usage is a global effect. `incremental.modulesHashes` has been overridden to false."
|
|
11229
|
+
"`optimization.usedExports` can't be used with `incremental.modulesHashes` as export usage is a global effect. `incremental.modulesHashes` has been overridden to false. We recommend enabling incremental only in the development mode."
|
|
11211
11230
|
);
|
|
11212
11231
|
}
|
|
11213
11232
|
if (incremental2.modulesCodegen) {
|
|
11214
11233
|
incremental2.modulesCodegen = false;
|
|
11215
11234
|
logger.warn(
|
|
11216
|
-
"`optimization.usedExports` can't be used with `incremental.modulesCodegen` as export usage is a global effect. `incremental.modulesCodegen` has been overridden to false."
|
|
11235
|
+
"`optimization.usedExports` can't be used with `incremental.modulesCodegen` as export usage is a global effect. `incremental.modulesCodegen` has been overridden to false. We recommend enabling incremental only in the development mode."
|
|
11217
11236
|
);
|
|
11218
11237
|
}
|
|
11219
11238
|
if (incremental2.modulesRuntimeRequirements) {
|
|
11220
11239
|
incremental2.modulesRuntimeRequirements = false;
|
|
11221
11240
|
logger.warn(
|
|
11222
|
-
"`optimization.usedExports` can't be used with `incremental.modulesRuntimeRequirements` as export usage is a global effect. `incremental.modulesRuntimeRequirements` has been overridden to false."
|
|
11241
|
+
"`optimization.usedExports` can't be used with `incremental.modulesRuntimeRequirements` as export usage is a global effect. `incremental.modulesRuntimeRequirements` has been overridden to false. We recommend enabling incremental only in the development mode."
|
|
11223
11242
|
);
|
|
11224
11243
|
}
|
|
11225
11244
|
return createBuiltinPlugin(this.name, this.global);
|
|
@@ -11227,11 +11246,11 @@ var FlagDependencyUsagePlugin = class extends RspackBuiltinPlugin {
|
|
|
11227
11246
|
};
|
|
11228
11247
|
|
|
11229
11248
|
// src/builtin-plugin/HotModuleReplacementPlugin.ts
|
|
11230
|
-
var
|
|
11249
|
+
var import_binding33 = require("@rspack/binding");
|
|
11231
11250
|
var HotModuleReplacementPlugin = class extends RspackBuiltinPlugin {
|
|
11232
11251
|
constructor() {
|
|
11233
11252
|
super(...arguments);
|
|
11234
|
-
this.name =
|
|
11253
|
+
this.name = import_binding33.BuiltinPluginName.HotModuleReplacementPlugin;
|
|
11235
11254
|
}
|
|
11236
11255
|
raw(compiler) {
|
|
11237
11256
|
if (compiler.options.output.strictModuleErrorHandling === void 0) {
|
|
@@ -11243,8 +11262,8 @@ var HotModuleReplacementPlugin = class extends RspackBuiltinPlugin {
|
|
|
11243
11262
|
|
|
11244
11263
|
// src/builtin-plugin/HtmlRspackPlugin.ts
|
|
11245
11264
|
var import_node_fs2 = __toESM(require("fs"));
|
|
11246
|
-
var
|
|
11247
|
-
var
|
|
11265
|
+
var import_node_path9 = __toESM(require("path"));
|
|
11266
|
+
var import_binding34 = require("@rspack/binding");
|
|
11248
11267
|
var liteTapable3 = __toESM(require("@rspack/lite-tapable"));
|
|
11249
11268
|
var import_zod3 = require("../compiled/zod/index.js");
|
|
11250
11269
|
|
|
@@ -11279,11 +11298,11 @@ function isNonEmptyArray(value) {
|
|
|
11279
11298
|
return value.length !== 0;
|
|
11280
11299
|
}
|
|
11281
11300
|
var identifierRegex = /[$_\p{ID_Start}][$\u200c\u200d\p{ID_Continue}]*/u;
|
|
11282
|
-
function joinPath(
|
|
11283
|
-
if (
|
|
11284
|
-
return
|
|
11301
|
+
function joinPath(path11) {
|
|
11302
|
+
if (path11.length === 1) {
|
|
11303
|
+
return path11[0].toString();
|
|
11285
11304
|
}
|
|
11286
|
-
return
|
|
11305
|
+
return path11.reduce((acc, item) => {
|
|
11287
11306
|
if (typeof item === "number") {
|
|
11288
11307
|
return acc + "[" + item.toString() + "]";
|
|
11289
11308
|
}
|
|
@@ -11534,7 +11553,7 @@ var htmlRspackPluginOptions = import_zod3.z.strictObject({
|
|
|
11534
11553
|
hash: import_zod3.z.boolean().optional()
|
|
11535
11554
|
});
|
|
11536
11555
|
var HtmlRspackPluginImpl = create2(
|
|
11537
|
-
|
|
11556
|
+
import_binding34.BuiltinPluginName.HtmlRspackPlugin,
|
|
11538
11557
|
function(c = {}) {
|
|
11539
11558
|
validate(c, htmlRspackPluginOptions);
|
|
11540
11559
|
const meta = {};
|
|
@@ -11613,10 +11632,10 @@ var HtmlRspackPluginImpl = create2(
|
|
|
11613
11632
|
templateContent = "";
|
|
11614
11633
|
} else if (c.template) {
|
|
11615
11634
|
const filename2 = c.template.split("?")[0];
|
|
11616
|
-
if ([".js", ".cjs"].includes(
|
|
11635
|
+
if ([".js", ".cjs"].includes(import_node_path9.default.extname(filename2))) {
|
|
11617
11636
|
templateFn = async (data) => {
|
|
11618
11637
|
const context2 = this.options.context || process.cwd();
|
|
11619
|
-
const templateFilePath =
|
|
11638
|
+
const templateFilePath = import_node_path9.default.resolve(context2, filename2);
|
|
11620
11639
|
if (!import_node_fs2.default.existsSync(templateFilePath)) {
|
|
11621
11640
|
throw new Error(
|
|
11622
11641
|
`HtmlRspackPlugin: could not load file \`${filename2}\` from \`${context2}\``
|
|
@@ -11773,9 +11792,9 @@ HtmlRspackPlugin.getHooks = HtmlRspackPlugin.getCompilationHooks = (compilation)
|
|
|
11773
11792
|
HtmlRspackPlugin.version = 5;
|
|
11774
11793
|
|
|
11775
11794
|
// src/builtin-plugin/HttpExternalsRspackPlugin.ts
|
|
11776
|
-
var
|
|
11795
|
+
var import_binding35 = require("@rspack/binding");
|
|
11777
11796
|
var HttpExternalsRspackPlugin = create2(
|
|
11778
|
-
|
|
11797
|
+
import_binding35.BuiltinPluginName.HttpExternalsRspackPlugin,
|
|
11779
11798
|
(css, webAsync) => {
|
|
11780
11799
|
return {
|
|
11781
11800
|
css,
|
|
@@ -11785,7 +11804,7 @@ var HttpExternalsRspackPlugin = create2(
|
|
|
11785
11804
|
);
|
|
11786
11805
|
|
|
11787
11806
|
// src/builtin-plugin/IgnorePlugin.ts
|
|
11788
|
-
var
|
|
11807
|
+
var import_binding36 = require("@rspack/binding");
|
|
11789
11808
|
var import_zod4 = require("../compiled/zod/index.js");
|
|
11790
11809
|
var IgnorePluginOptions = import_zod4.z.union([
|
|
11791
11810
|
import_zod4.z.object({
|
|
@@ -11797,7 +11816,7 @@ var IgnorePluginOptions = import_zod4.z.union([
|
|
|
11797
11816
|
})
|
|
11798
11817
|
]);
|
|
11799
11818
|
var IgnorePlugin = create2(
|
|
11800
|
-
|
|
11819
|
+
import_binding36.BuiltinPluginName.IgnorePlugin,
|
|
11801
11820
|
(options) => {
|
|
11802
11821
|
validate(options, IgnorePluginOptions);
|
|
11803
11822
|
return options;
|
|
@@ -11805,22 +11824,22 @@ var IgnorePlugin = create2(
|
|
|
11805
11824
|
);
|
|
11806
11825
|
|
|
11807
11826
|
// src/builtin-plugin/InferAsyncModulesPlugin.ts
|
|
11808
|
-
var
|
|
11827
|
+
var import_binding37 = require("@rspack/binding");
|
|
11809
11828
|
var InferAsyncModulesPlugin = create2(
|
|
11810
|
-
|
|
11829
|
+
import_binding37.BuiltinPluginName.InferAsyncModulesPlugin,
|
|
11811
11830
|
() => {
|
|
11812
11831
|
},
|
|
11813
11832
|
"compilation"
|
|
11814
11833
|
);
|
|
11815
11834
|
|
|
11816
11835
|
// src/builtin-plugin/JavascriptModulesPlugin.ts
|
|
11817
|
-
var
|
|
11836
|
+
var import_binding38 = require("@rspack/binding");
|
|
11818
11837
|
var liteTapable4 = __toESM(require("@rspack/lite-tapable"));
|
|
11819
11838
|
var compilationHooksMap3 = /* @__PURE__ */ new WeakMap();
|
|
11820
11839
|
var JavascriptModulesPlugin = class extends RspackBuiltinPlugin {
|
|
11821
11840
|
constructor() {
|
|
11822
11841
|
super(...arguments);
|
|
11823
|
-
this.name =
|
|
11842
|
+
this.name = import_binding38.BuiltinPluginName.JavascriptModulesPlugin;
|
|
11824
11843
|
this.affectedHooks = "compilation";
|
|
11825
11844
|
}
|
|
11826
11845
|
raw() {
|
|
@@ -11844,18 +11863,18 @@ var JavascriptModulesPlugin = class extends RspackBuiltinPlugin {
|
|
|
11844
11863
|
};
|
|
11845
11864
|
|
|
11846
11865
|
// src/builtin-plugin/JsLoaderRspackPlugin.ts
|
|
11847
|
-
var
|
|
11866
|
+
var import_binding39 = require("@rspack/binding");
|
|
11848
11867
|
var JsLoaderRspackPlugin = create2(
|
|
11849
|
-
|
|
11868
|
+
import_binding39.BuiltinPluginName.JsLoaderRspackPlugin,
|
|
11850
11869
|
(compiler) => runLoaders.bind(null, compiler),
|
|
11851
11870
|
/* Not Inheretable */
|
|
11852
11871
|
"thisCompilation"
|
|
11853
11872
|
);
|
|
11854
11873
|
|
|
11855
11874
|
// src/builtin-plugin/JsonModulesPlugin.ts
|
|
11856
|
-
var
|
|
11875
|
+
var import_binding40 = require("@rspack/binding");
|
|
11857
11876
|
var JsonModulesPlugin = create2(
|
|
11858
|
-
|
|
11877
|
+
import_binding40.BuiltinPluginName.JsonModulesPlugin,
|
|
11859
11878
|
() => {
|
|
11860
11879
|
},
|
|
11861
11880
|
"compilation"
|
|
@@ -11953,12 +11972,12 @@ var getBackend = (options) => (compiler, callback) => {
|
|
|
11953
11972
|
},
|
|
11954
11973
|
module({
|
|
11955
11974
|
module: originalModule,
|
|
11956
|
-
path:
|
|
11975
|
+
path: path11
|
|
11957
11976
|
}) {
|
|
11958
11977
|
const key = `${encodeURIComponent(
|
|
11959
11978
|
originalModule.replace(/\\/g, "/").replace(/@/g, "_")
|
|
11960
11979
|
).replace(/%(2F|3A|24|26|2B|2C|3B|3D|3A)/g, decodeURIComponent)}`;
|
|
11961
|
-
filesByKey.set(key,
|
|
11980
|
+
filesByKey.set(key, path11);
|
|
11962
11981
|
const active = activeModules.get(key) > 0;
|
|
11963
11982
|
return {
|
|
11964
11983
|
client: `${options.client}?${encodeURIComponent(urlBase + prefix)}`,
|
|
@@ -11991,9 +12010,9 @@ function moduleImpl(args) {
|
|
|
11991
12010
|
}
|
|
11992
12011
|
|
|
11993
12012
|
// src/builtin-plugin/lazy-compilation/lazyCompilation.ts
|
|
11994
|
-
var
|
|
12013
|
+
var import_binding41 = require("@rspack/binding");
|
|
11995
12014
|
var BuiltinLazyCompilationPlugin = create2(
|
|
11996
|
-
|
|
12015
|
+
import_binding41.BuiltinPluginName.LazyCompilationPlugin,
|
|
11997
12016
|
(module2, cacheable, entries, imports, test) => ({ module: module2, cacheable, imports, entries, test }),
|
|
11998
12017
|
"thisCompilation"
|
|
11999
12018
|
);
|
|
@@ -12038,21 +12057,21 @@ var LazyCompilationPlugin = class {
|
|
|
12038
12057
|
};
|
|
12039
12058
|
|
|
12040
12059
|
// src/builtin-plugin/LimitChunkCountPlugin.ts
|
|
12041
|
-
var
|
|
12060
|
+
var import_binding42 = require("@rspack/binding");
|
|
12042
12061
|
var LimitChunkCountPlugin = create2(
|
|
12043
|
-
|
|
12062
|
+
import_binding42.BuiltinPluginName.LimitChunkCountPlugin,
|
|
12044
12063
|
(options) => {
|
|
12045
12064
|
return options;
|
|
12046
12065
|
}
|
|
12047
12066
|
);
|
|
12048
12067
|
|
|
12049
12068
|
// src/builtin-plugin/MangleExportsPlugin.ts
|
|
12050
|
-
var
|
|
12069
|
+
var import_binding43 = require("@rspack/binding");
|
|
12051
12070
|
var MangleExportsPlugin = class extends RspackBuiltinPlugin {
|
|
12052
12071
|
constructor(deterministic) {
|
|
12053
12072
|
super();
|
|
12054
12073
|
this.deterministic = deterministic;
|
|
12055
|
-
this.name =
|
|
12074
|
+
this.name = import_binding43.BuiltinPluginName.MangleExportsPlugin;
|
|
12056
12075
|
this.affectedHooks = "compilation";
|
|
12057
12076
|
}
|
|
12058
12077
|
raw(compiler) {
|
|
@@ -12063,19 +12082,19 @@ var MangleExportsPlugin = class extends RspackBuiltinPlugin {
|
|
|
12063
12082
|
if (incremental2.modulesHashes) {
|
|
12064
12083
|
incremental2.modulesHashes = false;
|
|
12065
12084
|
logger.warn(
|
|
12066
|
-
"`optimization.mangleExports` can't be used with `incremental.modulesHashes` as export mangling is a global effect. `incremental.modulesHashes` has been overridden to false."
|
|
12085
|
+
"`optimization.mangleExports` can't be used with `incremental.modulesHashes` as export mangling is a global effect. `incremental.modulesHashes` has been overridden to false. We recommend enabling incremental only in the development mode."
|
|
12067
12086
|
);
|
|
12068
12087
|
}
|
|
12069
12088
|
if (incremental2.modulesCodegen) {
|
|
12070
12089
|
incremental2.modulesCodegen = false;
|
|
12071
12090
|
logger.warn(
|
|
12072
|
-
"`optimization.mangleExports` can't be used with `incremental.modulesCodegen` as export mangling is a global effect. `incremental.modulesCodegen` has been overridden to false."
|
|
12091
|
+
"`optimization.mangleExports` can't be used with `incremental.modulesCodegen` as export mangling is a global effect. `incremental.modulesCodegen` has been overridden to false. We recommend enabling incremental only in the development mode."
|
|
12073
12092
|
);
|
|
12074
12093
|
}
|
|
12075
12094
|
if (incremental2.modulesRuntimeRequirements) {
|
|
12076
12095
|
incremental2.modulesRuntimeRequirements = false;
|
|
12077
12096
|
logger.warn(
|
|
12078
|
-
"`optimization.mangleExports` can't be used with `incremental.modulesRuntimeRequirements` as export mangling is a global effect. `incremental.modulesRuntimeRequirements` has been overridden to false."
|
|
12097
|
+
"`optimization.mangleExports` can't be used with `incremental.modulesRuntimeRequirements` as export mangling is a global effect. `incremental.modulesRuntimeRequirements` has been overridden to false. We recommend enabling incremental only in the development mode."
|
|
12079
12098
|
);
|
|
12080
12099
|
}
|
|
12081
12100
|
return createBuiltinPlugin(this.name, this.deterministic);
|
|
@@ -12083,27 +12102,27 @@ var MangleExportsPlugin = class extends RspackBuiltinPlugin {
|
|
|
12083
12102
|
};
|
|
12084
12103
|
|
|
12085
12104
|
// src/builtin-plugin/MergeDuplicateChunksPlugin.ts
|
|
12086
|
-
var
|
|
12105
|
+
var import_binding44 = require("@rspack/binding");
|
|
12087
12106
|
var MergeDuplicateChunksPlugin = create2(
|
|
12088
|
-
|
|
12107
|
+
import_binding44.BuiltinPluginName.MergeDuplicateChunksPlugin,
|
|
12089
12108
|
() => {
|
|
12090
12109
|
}
|
|
12091
12110
|
);
|
|
12092
12111
|
|
|
12093
12112
|
// src/builtin-plugin/ModuleChunkFormatPlugin.ts
|
|
12094
|
-
var
|
|
12113
|
+
var import_binding45 = require("@rspack/binding");
|
|
12095
12114
|
var ModuleChunkFormatPlugin = create2(
|
|
12096
|
-
|
|
12115
|
+
import_binding45.BuiltinPluginName.ModuleChunkFormatPlugin,
|
|
12097
12116
|
() => {
|
|
12098
12117
|
}
|
|
12099
12118
|
);
|
|
12100
12119
|
|
|
12101
12120
|
// src/builtin-plugin/ModuleConcatenationPlugin.ts
|
|
12102
|
-
var
|
|
12121
|
+
var import_binding46 = require("@rspack/binding");
|
|
12103
12122
|
var ModuleConcatenationPlugin = class extends RspackBuiltinPlugin {
|
|
12104
12123
|
constructor() {
|
|
12105
12124
|
super(...arguments);
|
|
12106
|
-
this.name =
|
|
12125
|
+
this.name = import_binding46.BuiltinPluginName.ModuleConcatenationPlugin;
|
|
12107
12126
|
this.affectedHooks = "compilation";
|
|
12108
12127
|
}
|
|
12109
12128
|
raw(compiler) {
|
|
@@ -12114,43 +12133,43 @@ var ModuleConcatenationPlugin = class extends RspackBuiltinPlugin {
|
|
|
12114
12133
|
if (incremental2.moduleIds) {
|
|
12115
12134
|
incremental2.moduleIds = false;
|
|
12116
12135
|
logger.warn(
|
|
12117
|
-
"`optimization.concatenateModules` can't be used with `incremental.moduleIds` as module concatenation is a global effect. `incremental.moduleIds` has been overridden to false."
|
|
12136
|
+
"`optimization.concatenateModules` can't be used with `incremental.moduleIds` as module concatenation is a global effect. `incremental.moduleIds` has been overridden to false. We recommend enabling incremental only in the development mode."
|
|
12118
12137
|
);
|
|
12119
12138
|
}
|
|
12120
12139
|
if (incremental2.modulesHashes) {
|
|
12121
12140
|
incremental2.modulesHashes = false;
|
|
12122
12141
|
logger.warn(
|
|
12123
|
-
"`optimization.concatenateModules` can't be used with `incremental.modulesHashes` as module concatenation is a global effect. `incremental.modulesHashes` has been overridden to false."
|
|
12142
|
+
"`optimization.concatenateModules` can't be used with `incremental.modulesHashes` as module concatenation is a global effect. `incremental.modulesHashes` has been overridden to false. We recommend enabling incremental only in the development mode."
|
|
12124
12143
|
);
|
|
12125
12144
|
}
|
|
12126
12145
|
if (incremental2.modulesCodegen) {
|
|
12127
12146
|
incremental2.modulesCodegen = false;
|
|
12128
12147
|
logger.warn(
|
|
12129
|
-
"`optimization.concatenateModules` can't be used with `incremental.modulesCodegen` as module concatenation is a global effect. `incremental.modulesCodegen` has been overridden to false."
|
|
12148
|
+
"`optimization.concatenateModules` can't be used with `incremental.modulesCodegen` as module concatenation is a global effect. `incremental.modulesCodegen` has been overridden to false. We recommend enabling incremental only in the development mode."
|
|
12130
12149
|
);
|
|
12131
12150
|
}
|
|
12132
12151
|
if (incremental2.modulesRuntimeRequirements) {
|
|
12133
12152
|
incremental2.modulesRuntimeRequirements = false;
|
|
12134
12153
|
logger.warn(
|
|
12135
|
-
"`optimization.concatenateModules` can't be used with `incremental.modulesRuntimeRequirements` as module concatenation is a global effect. `incremental.modulesRuntimeRequirements` has been overridden to false."
|
|
12154
|
+
"`optimization.concatenateModules` can't be used with `incremental.modulesRuntimeRequirements` as module concatenation is a global effect. `incremental.modulesRuntimeRequirements` has been overridden to false. We recommend enabling incremental only in the development mode."
|
|
12136
12155
|
);
|
|
12137
12156
|
}
|
|
12138
12157
|
if (incremental2.chunksRuntimeRequirements) {
|
|
12139
12158
|
incremental2.chunksRuntimeRequirements = false;
|
|
12140
12159
|
logger.warn(
|
|
12141
|
-
"`optimization.concatenateModules` can't be used with `incremental.chunksRuntimeRequirements` as module concatenation is a global effect. `incremental.chunksRuntimeRequirements` has been overridden to false."
|
|
12160
|
+
"`optimization.concatenateModules` can't be used with `incremental.chunksRuntimeRequirements` as module concatenation is a global effect. `incremental.chunksRuntimeRequirements` has been overridden to false. We recommend enabling incremental only in the development mode."
|
|
12142
12161
|
);
|
|
12143
12162
|
}
|
|
12144
12163
|
if (incremental2.chunksHashes) {
|
|
12145
12164
|
incremental2.chunksHashes = false;
|
|
12146
12165
|
logger.warn(
|
|
12147
|
-
"`optimization.concatenateModules` can't be used with `incremental.chunksHashes` as module concatenation is a global effect. `incremental.chunksHashes` has been overridden to false."
|
|
12166
|
+
"`optimization.concatenateModules` can't be used with `incremental.chunksHashes` as module concatenation is a global effect. `incremental.chunksHashes` has been overridden to false. We recommend enabling incremental only in the development mode."
|
|
12148
12167
|
);
|
|
12149
12168
|
}
|
|
12150
12169
|
if (incremental2.chunksRender) {
|
|
12151
12170
|
incremental2.chunksRender = false;
|
|
12152
12171
|
logger.warn(
|
|
12153
|
-
"`optimization.concatenateModules` can't be used with `incremental.chunksRender` as module concatenation is a global effect. `incremental.chunksRender` has been overridden to false."
|
|
12172
|
+
"`optimization.concatenateModules` can't be used with `incremental.chunksRender` as module concatenation is a global effect. `incremental.chunksRender` has been overridden to false. We recommend enabling incremental only in the development mode."
|
|
12154
12173
|
);
|
|
12155
12174
|
}
|
|
12156
12175
|
return createBuiltinPlugin(this.name, void 0);
|
|
@@ -12158,38 +12177,52 @@ var ModuleConcatenationPlugin = class extends RspackBuiltinPlugin {
|
|
|
12158
12177
|
};
|
|
12159
12178
|
|
|
12160
12179
|
// src/builtin-plugin/NamedChunkIdsPlugin.ts
|
|
12161
|
-
var
|
|
12180
|
+
var import_binding47 = require("@rspack/binding");
|
|
12162
12181
|
var NamedChunkIdsPlugin = create2(
|
|
12163
|
-
|
|
12182
|
+
import_binding47.BuiltinPluginName.NamedChunkIdsPlugin,
|
|
12164
12183
|
() => {
|
|
12165
12184
|
},
|
|
12166
12185
|
"compilation"
|
|
12167
12186
|
);
|
|
12168
12187
|
|
|
12169
12188
|
// src/builtin-plugin/NamedModuleIdsPlugin.ts
|
|
12170
|
-
var
|
|
12189
|
+
var import_binding48 = require("@rspack/binding");
|
|
12171
12190
|
var NamedModuleIdsPlugin = create2(
|
|
12172
|
-
|
|
12191
|
+
import_binding48.BuiltinPluginName.NamedModuleIdsPlugin,
|
|
12173
12192
|
() => {
|
|
12174
12193
|
},
|
|
12175
12194
|
"compilation"
|
|
12176
12195
|
);
|
|
12177
12196
|
|
|
12178
12197
|
// src/builtin-plugin/NaturalChunkIdsPlugin.ts
|
|
12179
|
-
var
|
|
12180
|
-
var NaturalChunkIdsPlugin =
|
|
12181
|
-
|
|
12182
|
-
|
|
12183
|
-
|
|
12184
|
-
|
|
12185
|
-
|
|
12198
|
+
var import_binding49 = require("@rspack/binding");
|
|
12199
|
+
var NaturalChunkIdsPlugin = class extends RspackBuiltinPlugin {
|
|
12200
|
+
constructor() {
|
|
12201
|
+
super(...arguments);
|
|
12202
|
+
this.name = import_binding49.BuiltinPluginName.NaturalChunkIdsPlugin;
|
|
12203
|
+
this.affectedHooks = "compilation";
|
|
12204
|
+
}
|
|
12205
|
+
raw(compiler) {
|
|
12206
|
+
const incremental2 = compiler.options.experiments.incremental;
|
|
12207
|
+
const logger = compiler.getInfrastructureLogger(
|
|
12208
|
+
"rspack.NaturalChunkIdsPlugin"
|
|
12209
|
+
);
|
|
12210
|
+
if (incremental2.moduleIds) {
|
|
12211
|
+
incremental2.moduleIds = false;
|
|
12212
|
+
logger.warn(
|
|
12213
|
+
"`optimization.chunkIds = 'natural'` can't be used with `incremental.chunkIds` as natural chunk ids is a global effect. `incremental.chunkIds` has been overridden to false. We recommend enabling incremental only in the development mode."
|
|
12214
|
+
);
|
|
12215
|
+
}
|
|
12216
|
+
return createBuiltinPlugin(this.name, void 0);
|
|
12217
|
+
}
|
|
12218
|
+
};
|
|
12186
12219
|
|
|
12187
12220
|
// src/builtin-plugin/NaturalModuleIdsPlugin.ts
|
|
12188
|
-
var
|
|
12221
|
+
var import_binding50 = require("@rspack/binding");
|
|
12189
12222
|
var NaturalModuleIdsPlugin = class extends RspackBuiltinPlugin {
|
|
12190
12223
|
constructor() {
|
|
12191
12224
|
super(...arguments);
|
|
12192
|
-
this.name =
|
|
12225
|
+
this.name = import_binding50.BuiltinPluginName.NaturalModuleIdsPlugin;
|
|
12193
12226
|
this.affectedHooks = "compilation";
|
|
12194
12227
|
}
|
|
12195
12228
|
raw(compiler) {
|
|
@@ -12200,7 +12233,7 @@ var NaturalModuleIdsPlugin = class extends RspackBuiltinPlugin {
|
|
|
12200
12233
|
if (incremental2.moduleIds) {
|
|
12201
12234
|
incremental2.moduleIds = false;
|
|
12202
12235
|
logger.warn(
|
|
12203
|
-
"`optimization.moduleIds = 'natural'` can't be used with `incremental.moduleIds` as natural module ids is a global effect. `incremental.moduleIds` has been overridden to false."
|
|
12236
|
+
"`optimization.moduleIds = 'natural'` can't be used with `incremental.moduleIds` as natural module ids is a global effect. `incremental.moduleIds` has been overridden to false. We recommend enabling incremental only in the development mode."
|
|
12204
12237
|
);
|
|
12205
12238
|
}
|
|
12206
12239
|
return createBuiltinPlugin(this.name, void 0);
|
|
@@ -12208,16 +12241,24 @@ var NaturalModuleIdsPlugin = class extends RspackBuiltinPlugin {
|
|
|
12208
12241
|
};
|
|
12209
12242
|
|
|
12210
12243
|
// src/builtin-plugin/NodeTargetPlugin.ts
|
|
12211
|
-
var
|
|
12244
|
+
var import_binding51 = require("@rspack/binding");
|
|
12212
12245
|
var NodeTargetPlugin = create2(
|
|
12213
|
-
|
|
12246
|
+
import_binding51.BuiltinPluginName.NodeTargetPlugin,
|
|
12214
12247
|
() => void 0
|
|
12215
12248
|
);
|
|
12216
12249
|
|
|
12250
|
+
// src/builtin-plugin/OccurrenceChunkIdsPlugin.ts
|
|
12251
|
+
var import_binding52 = require("@rspack/binding");
|
|
12252
|
+
var OccurrenceChunkIdsPlugin = create2(
|
|
12253
|
+
import_binding52.BuiltinPluginName.OccurrenceChunkIdsPlugin,
|
|
12254
|
+
(options) => ({ ...options }),
|
|
12255
|
+
"compilation"
|
|
12256
|
+
);
|
|
12257
|
+
|
|
12217
12258
|
// src/builtin-plugin/ProgressPlugin.ts
|
|
12218
|
-
var
|
|
12259
|
+
var import_binding53 = require("@rspack/binding");
|
|
12219
12260
|
var ProgressPlugin = create2(
|
|
12220
|
-
|
|
12261
|
+
import_binding53.BuiltinPluginName.ProgressPlugin,
|
|
12221
12262
|
(progress = {}) => {
|
|
12222
12263
|
if (typeof progress === "function") {
|
|
12223
12264
|
return {
|
|
@@ -12231,9 +12272,9 @@ var ProgressPlugin = create2(
|
|
|
12231
12272
|
);
|
|
12232
12273
|
|
|
12233
12274
|
// src/builtin-plugin/ProvidePlugin.ts
|
|
12234
|
-
var
|
|
12275
|
+
var import_binding54 = require("@rspack/binding");
|
|
12235
12276
|
var ProvidePlugin = create2(
|
|
12236
|
-
|
|
12277
|
+
import_binding54.BuiltinPluginName.ProvidePlugin,
|
|
12237
12278
|
(provide) => {
|
|
12238
12279
|
const entries = Object.entries(provide).map(([key, value]) => {
|
|
12239
12280
|
if (typeof value === "string") {
|
|
@@ -12247,53 +12288,53 @@ var ProvidePlugin = create2(
|
|
|
12247
12288
|
);
|
|
12248
12289
|
|
|
12249
12290
|
// src/builtin-plugin/RealContentHashPlugin.ts
|
|
12250
|
-
var
|
|
12291
|
+
var import_binding55 = require("@rspack/binding");
|
|
12251
12292
|
var RealContentHashPlugin = create2(
|
|
12252
|
-
|
|
12293
|
+
import_binding55.BuiltinPluginName.RealContentHashPlugin,
|
|
12253
12294
|
() => {
|
|
12254
12295
|
},
|
|
12255
12296
|
"compilation"
|
|
12256
12297
|
);
|
|
12257
12298
|
|
|
12258
12299
|
// src/builtin-plugin/RemoveEmptyChunksPlugin.ts
|
|
12259
|
-
var
|
|
12300
|
+
var import_binding56 = require("@rspack/binding");
|
|
12260
12301
|
var RemoveEmptyChunksPlugin = create2(
|
|
12261
|
-
|
|
12302
|
+
import_binding56.BuiltinPluginName.RemoveEmptyChunksPlugin,
|
|
12262
12303
|
() => {
|
|
12263
12304
|
},
|
|
12264
12305
|
"compilation"
|
|
12265
12306
|
);
|
|
12266
12307
|
|
|
12267
12308
|
// src/builtin-plugin/RuntimeChunkPlugin.ts
|
|
12268
|
-
var
|
|
12309
|
+
var import_binding57 = require("@rspack/binding");
|
|
12269
12310
|
var RuntimeChunkPlugin = create2(
|
|
12270
|
-
|
|
12311
|
+
import_binding57.BuiltinPluginName.RuntimeChunkPlugin,
|
|
12271
12312
|
(options) => options,
|
|
12272
12313
|
"thisCompilation"
|
|
12273
12314
|
);
|
|
12274
12315
|
|
|
12275
12316
|
// src/builtin-plugin/RuntimePlugin.ts
|
|
12276
|
-
var
|
|
12317
|
+
var import_binding58 = require("@rspack/binding");
|
|
12277
12318
|
var RuntimePlugin = create2(
|
|
12278
|
-
|
|
12319
|
+
import_binding58.BuiltinPluginName.RuntimePlugin,
|
|
12279
12320
|
() => {
|
|
12280
12321
|
},
|
|
12281
12322
|
"compilation"
|
|
12282
12323
|
);
|
|
12283
12324
|
|
|
12284
12325
|
// src/builtin-plugin/SideEffectsFlagPlugin.ts
|
|
12285
|
-
var
|
|
12326
|
+
var import_binding59 = require("@rspack/binding");
|
|
12286
12327
|
var SideEffectsFlagPlugin = create2(
|
|
12287
|
-
|
|
12328
|
+
import_binding59.BuiltinPluginName.SideEffectsFlagPlugin,
|
|
12288
12329
|
() => {
|
|
12289
12330
|
},
|
|
12290
12331
|
"compilation"
|
|
12291
12332
|
);
|
|
12292
12333
|
|
|
12293
12334
|
// src/builtin-plugin/SizeLimitsPlugin.ts
|
|
12294
|
-
var
|
|
12335
|
+
var import_binding60 = require("@rspack/binding");
|
|
12295
12336
|
var SizeLimitsPlugin = create2(
|
|
12296
|
-
|
|
12337
|
+
import_binding60.BuiltinPluginName.SizeLimitsPlugin,
|
|
12297
12338
|
(options) => {
|
|
12298
12339
|
const hints = options.hints === false ? void 0 : options.hints;
|
|
12299
12340
|
return { ...options, hints };
|
|
@@ -12301,16 +12342,16 @@ var SizeLimitsPlugin = create2(
|
|
|
12301
12342
|
);
|
|
12302
12343
|
|
|
12303
12344
|
// src/builtin-plugin/SourceMapDevToolPlugin.ts
|
|
12304
|
-
var
|
|
12345
|
+
var import_binding61 = require("@rspack/binding");
|
|
12305
12346
|
var SourceMapDevToolPlugin = create2(
|
|
12306
|
-
|
|
12347
|
+
import_binding61.BuiltinPluginName.SourceMapDevToolPlugin,
|
|
12307
12348
|
(options) => options,
|
|
12308
12349
|
"compilation"
|
|
12309
12350
|
);
|
|
12310
12351
|
|
|
12311
12352
|
// src/builtin-plugin/SplitChunksPlugin.ts
|
|
12312
12353
|
var import_node_assert5 = __toESM(require("assert"));
|
|
12313
|
-
var
|
|
12354
|
+
var import_binding62 = require("@rspack/binding");
|
|
12314
12355
|
|
|
12315
12356
|
// src/util/SplitChunkSize.ts
|
|
12316
12357
|
var JsSplitChunkSizes = class {
|
|
@@ -12333,7 +12374,7 @@ var SplitChunksPlugin = class extends RspackBuiltinPlugin {
|
|
|
12333
12374
|
constructor(options) {
|
|
12334
12375
|
super();
|
|
12335
12376
|
this.options = options;
|
|
12336
|
-
this.name =
|
|
12377
|
+
this.name = import_binding62.BuiltinPluginName.SplitChunksPlugin;
|
|
12337
12378
|
this.affectedHooks = "thisCompilation";
|
|
12338
12379
|
}
|
|
12339
12380
|
raw(compiler) {
|
|
@@ -12376,12 +12417,7 @@ function toRawSplitChunksOptions(sc, compiler) {
|
|
|
12376
12417
|
}
|
|
12377
12418
|
function getChunks(chunks2) {
|
|
12378
12419
|
if (typeof chunks2 === "function") {
|
|
12379
|
-
return (chunk) => chunks2(
|
|
12380
|
-
Chunk.__from_binding(
|
|
12381
|
-
chunk,
|
|
12382
|
-
compiler._lastCompilation.__internal_getInner()
|
|
12383
|
-
)
|
|
12384
|
-
);
|
|
12420
|
+
return (chunk) => chunks2(Chunk.__from_binding(chunk));
|
|
12385
12421
|
}
|
|
12386
12422
|
return chunks2;
|
|
12387
12423
|
}
|
|
@@ -12439,9 +12475,9 @@ function toRawSplitChunksOptions(sc, compiler) {
|
|
|
12439
12475
|
}
|
|
12440
12476
|
|
|
12441
12477
|
// src/builtin-plugin/LightningCssMinimizerRspackPlugin.ts
|
|
12442
|
-
var
|
|
12478
|
+
var import_binding63 = require("@rspack/binding");
|
|
12443
12479
|
var LightningCssMinimizerRspackPlugin = create2(
|
|
12444
|
-
|
|
12480
|
+
import_binding63.BuiltinPluginName.LightningCssMinimizerRspackPlugin,
|
|
12445
12481
|
(options) => {
|
|
12446
12482
|
var _a, _b, _c;
|
|
12447
12483
|
const { include, exclude, draft, nonStandard, pseudoClasses, drafts } = (options == null ? void 0 : options.minimizerOptions) ?? {};
|
|
@@ -12469,16 +12505,16 @@ var LightningCssMinimizerRspackPlugin = create2(
|
|
|
12469
12505
|
);
|
|
12470
12506
|
|
|
12471
12507
|
// src/builtin-plugin/RemoveDuplicateModulesPlugin.ts
|
|
12472
|
-
var
|
|
12508
|
+
var import_binding64 = require("@rspack/binding");
|
|
12473
12509
|
var RemoveDuplicateModulesPlugin = create2(
|
|
12474
|
-
|
|
12510
|
+
import_binding64.BuiltinPluginName.RemoveDuplicateModulesPlugin,
|
|
12475
12511
|
() => {
|
|
12476
12512
|
return {};
|
|
12477
12513
|
}
|
|
12478
12514
|
);
|
|
12479
12515
|
|
|
12480
12516
|
// src/builtin-plugin/SwcJsMinimizerPlugin.ts
|
|
12481
|
-
var
|
|
12517
|
+
var import_binding65 = require("@rspack/binding");
|
|
12482
12518
|
function isObject2(value) {
|
|
12483
12519
|
const type = typeof value;
|
|
12484
12520
|
return value != null && (type === "object" || type === "function");
|
|
@@ -12521,7 +12557,7 @@ function getRawExtractCommentsOptions(extractComments) {
|
|
|
12521
12557
|
return void 0;
|
|
12522
12558
|
}
|
|
12523
12559
|
var SwcJsMinimizerRspackPlugin = create2(
|
|
12524
|
-
|
|
12560
|
+
import_binding65.BuiltinPluginName.SwcJsMinimizerRspackPlugin,
|
|
12525
12561
|
(options) => {
|
|
12526
12562
|
var _a, _b, _c, _d, _e;
|
|
12527
12563
|
let compress = ((_a = options == null ? void 0 : options.minimizerOptions) == null ? void 0 : _a.compress) ?? true;
|
|
@@ -12533,13 +12569,12 @@ var SwcJsMinimizerRspackPlugin = create2(
|
|
|
12533
12569
|
};
|
|
12534
12570
|
if (compress && typeof compress === "object") {
|
|
12535
12571
|
compress = {
|
|
12536
|
-
passes:
|
|
12537
|
-
// terser and swc use different default value: 0
|
|
12572
|
+
passes: 2,
|
|
12538
12573
|
...compress
|
|
12539
12574
|
};
|
|
12540
12575
|
} else if (compress) {
|
|
12541
12576
|
compress = {
|
|
12542
|
-
passes:
|
|
12577
|
+
passes: 2
|
|
12543
12578
|
};
|
|
12544
12579
|
}
|
|
12545
12580
|
return {
|
|
@@ -12560,20 +12595,20 @@ var SwcJsMinimizerRspackPlugin = create2(
|
|
|
12560
12595
|
);
|
|
12561
12596
|
|
|
12562
12597
|
// src/builtin-plugin/WarnCaseSensitiveModulesPlugin.ts
|
|
12563
|
-
var
|
|
12598
|
+
var import_binding66 = require("@rspack/binding");
|
|
12564
12599
|
var WarnCaseSensitiveModulesPlugin = create2(
|
|
12565
|
-
|
|
12600
|
+
import_binding66.BuiltinPluginName.WarnCaseSensitiveModulesPlugin,
|
|
12566
12601
|
() => {
|
|
12567
12602
|
},
|
|
12568
12603
|
"compilation"
|
|
12569
12604
|
);
|
|
12570
12605
|
|
|
12571
12606
|
// src/builtin-plugin/WebWorkerTemplatePlugin.ts
|
|
12572
|
-
var
|
|
12607
|
+
var import_binding67 = require("@rspack/binding");
|
|
12573
12608
|
var WebWorkerTemplatePlugin = class extends RspackBuiltinPlugin {
|
|
12574
12609
|
constructor() {
|
|
12575
12610
|
super(...arguments);
|
|
12576
|
-
this.name =
|
|
12611
|
+
this.name = import_binding67.BuiltinPluginName.WebWorkerTemplatePlugin;
|
|
12577
12612
|
}
|
|
12578
12613
|
raw(compiler) {
|
|
12579
12614
|
compiler.options.output.chunkLoading = "import-scripts";
|
|
@@ -12582,7 +12617,7 @@ var WebWorkerTemplatePlugin = class extends RspackBuiltinPlugin {
|
|
|
12582
12617
|
};
|
|
12583
12618
|
|
|
12584
12619
|
// src/builtin-plugin/WorkerPlugin.ts
|
|
12585
|
-
var
|
|
12620
|
+
var import_binding68 = require("@rspack/binding");
|
|
12586
12621
|
var WorkerPlugin = class extends RspackBuiltinPlugin {
|
|
12587
12622
|
constructor(chunkLoading2, wasmLoading2, module2, workerPublicPath2) {
|
|
12588
12623
|
super();
|
|
@@ -12590,7 +12625,7 @@ var WorkerPlugin = class extends RspackBuiltinPlugin {
|
|
|
12590
12625
|
this.wasmLoading = wasmLoading2;
|
|
12591
12626
|
this.module = module2;
|
|
12592
12627
|
this.workerPublicPath = workerPublicPath2;
|
|
12593
|
-
this.name =
|
|
12628
|
+
this.name = import_binding68.BuiltinPluginName.WorkerPlugin;
|
|
12594
12629
|
}
|
|
12595
12630
|
raw(compiler) {
|
|
12596
12631
|
if (this.chunkLoading) {
|
|
@@ -12604,25 +12639,25 @@ var WorkerPlugin = class extends RspackBuiltinPlugin {
|
|
|
12604
12639
|
};
|
|
12605
12640
|
|
|
12606
12641
|
// src/builtin-plugin/FetchCompileAsyncWasmPlugin.ts
|
|
12607
|
-
var
|
|
12642
|
+
var import_binding69 = require("@rspack/binding");
|
|
12608
12643
|
var FetchCompileAsyncWasmPlugin = create2(
|
|
12609
|
-
|
|
12644
|
+
import_binding69.BuiltinPluginName.FetchCompileAsyncWasmPlugin,
|
|
12610
12645
|
() => {
|
|
12611
12646
|
},
|
|
12612
12647
|
"thisCompilation"
|
|
12613
12648
|
);
|
|
12614
12649
|
|
|
12615
12650
|
// src/builtin-plugin/NoEmitOnErrorsPlugin.ts
|
|
12616
|
-
var
|
|
12651
|
+
var import_binding70 = require("@rspack/binding");
|
|
12617
12652
|
var NoEmitOnErrorsPlugin = create2(
|
|
12618
|
-
|
|
12653
|
+
import_binding70.BuiltinPluginName.NoEmitOnErrorsPlugin,
|
|
12619
12654
|
() => void 0
|
|
12620
12655
|
);
|
|
12621
12656
|
|
|
12622
12657
|
// src/builtin-plugin/ContextReplacementPlugin.ts
|
|
12623
|
-
var
|
|
12658
|
+
var import_binding71 = require("@rspack/binding");
|
|
12624
12659
|
var ContextReplacementPlugin = create2(
|
|
12625
|
-
|
|
12660
|
+
import_binding71.BuiltinPluginName.ContextReplacementPlugin,
|
|
12626
12661
|
(resourceRegExp, newContentResource, newContentRecursive, newContentRegExp) => {
|
|
12627
12662
|
const rawOptions = {
|
|
12628
12663
|
resourceRegExp
|
|
@@ -12652,26 +12687,26 @@ var ContextReplacementPlugin = create2(
|
|
|
12652
12687
|
);
|
|
12653
12688
|
|
|
12654
12689
|
// src/builtin-plugin/LibManifestPlugin.ts
|
|
12655
|
-
var
|
|
12690
|
+
var import_binding72 = require("@rspack/binding");
|
|
12656
12691
|
var LibManifestPlugin = create2(
|
|
12657
|
-
|
|
12692
|
+
import_binding72.BuiltinPluginName.LibManifestPlugin,
|
|
12658
12693
|
(options) => {
|
|
12659
|
-
const { context: context2, entryOnly, format: format3, name: name2, path:
|
|
12694
|
+
const { context: context2, entryOnly, format: format3, name: name2, path: path11, type } = options;
|
|
12660
12695
|
return {
|
|
12661
12696
|
context: context2,
|
|
12662
12697
|
entryOnly,
|
|
12663
12698
|
format: format3,
|
|
12664
12699
|
name: name2,
|
|
12665
|
-
path:
|
|
12700
|
+
path: path11,
|
|
12666
12701
|
type
|
|
12667
12702
|
};
|
|
12668
12703
|
}
|
|
12669
12704
|
);
|
|
12670
12705
|
|
|
12671
12706
|
// src/builtin-plugin/DllEntryPlugin.ts
|
|
12672
|
-
var
|
|
12707
|
+
var import_binding73 = require("@rspack/binding");
|
|
12673
12708
|
var DllEntryPlugin = create2(
|
|
12674
|
-
|
|
12709
|
+
import_binding73.BuiltinPluginName.DllEntryPlugin,
|
|
12675
12710
|
(context2, entries, options) => {
|
|
12676
12711
|
return {
|
|
12677
12712
|
context: context2,
|
|
@@ -12682,9 +12717,9 @@ var DllEntryPlugin = create2(
|
|
|
12682
12717
|
);
|
|
12683
12718
|
|
|
12684
12719
|
// src/builtin-plugin/DllReferenceAgencyPlugin.ts
|
|
12685
|
-
var
|
|
12720
|
+
var import_binding74 = require("@rspack/binding");
|
|
12686
12721
|
var DllReferenceAgencyPlugin = create2(
|
|
12687
|
-
|
|
12722
|
+
import_binding74.BuiltinPluginName.DllReferenceAgencyPlugin,
|
|
12688
12723
|
(options) => options
|
|
12689
12724
|
);
|
|
12690
12725
|
|
|
@@ -12704,7 +12739,7 @@ var import_node_util5 = __toESM(require("util"));
|
|
|
12704
12739
|
|
|
12705
12740
|
// src/util/fs.ts
|
|
12706
12741
|
var import_node_assert6 = __toESM(require("assert"));
|
|
12707
|
-
var
|
|
12742
|
+
var import_node_path10 = __toESM(require("path"));
|
|
12708
12743
|
function rmrf(fs5, p, callback) {
|
|
12709
12744
|
fs5.stat(p, (err, stats) => {
|
|
12710
12745
|
if (err) {
|
|
@@ -12746,11 +12781,11 @@ var join2 = (fs5, rootPath, filename2) => {
|
|
|
12746
12781
|
if (fs5 == null ? void 0 : fs5.join) {
|
|
12747
12782
|
return fs5.join(rootPath, filename2);
|
|
12748
12783
|
}
|
|
12749
|
-
if (
|
|
12750
|
-
return
|
|
12784
|
+
if (import_node_path10.default.posix.isAbsolute(rootPath)) {
|
|
12785
|
+
return import_node_path10.default.posix.join(rootPath, filename2);
|
|
12751
12786
|
}
|
|
12752
|
-
if (
|
|
12753
|
-
return
|
|
12787
|
+
if (import_node_path10.default.win32.isAbsolute(rootPath)) {
|
|
12788
|
+
return import_node_path10.default.win32.join(rootPath, filename2);
|
|
12754
12789
|
}
|
|
12755
12790
|
throw new Error(
|
|
12756
12791
|
`${rootPath} is neither a posix nor a windows path, and there is no 'join' method defined in the file system`
|
|
@@ -12760,11 +12795,11 @@ var dirname2 = (fs5, absPath) => {
|
|
|
12760
12795
|
if (fs5 == null ? void 0 : fs5.dirname) {
|
|
12761
12796
|
return fs5.dirname(absPath);
|
|
12762
12797
|
}
|
|
12763
|
-
if (
|
|
12764
|
-
return
|
|
12798
|
+
if (import_node_path10.default.posix.isAbsolute(absPath)) {
|
|
12799
|
+
return import_node_path10.default.posix.dirname(absPath);
|
|
12765
12800
|
}
|
|
12766
|
-
if (
|
|
12767
|
-
return
|
|
12801
|
+
if (import_node_path10.default.win32.isAbsolute(absPath)) {
|
|
12802
|
+
return import_node_path10.default.win32.dirname(absPath);
|
|
12768
12803
|
}
|
|
12769
12804
|
throw new Error(
|
|
12770
12805
|
`${absPath} is neither a posix nor a windows path, and there is no 'dirname' method defined in the file system`
|
|
@@ -12811,41 +12846,26 @@ var mkdirp = (fs5, p, callback) => {
|
|
|
12811
12846
|
|
|
12812
12847
|
// src/FileSystem.ts
|
|
12813
12848
|
var BUFFER_SIZE = 1e3;
|
|
12849
|
+
var ASYNC_NOOP = async () => {
|
|
12850
|
+
};
|
|
12814
12851
|
var NOOP_FILESYSTEM = {
|
|
12815
|
-
writeFile
|
|
12816
|
-
|
|
12817
|
-
|
|
12818
|
-
|
|
12819
|
-
|
|
12820
|
-
|
|
12821
|
-
|
|
12822
|
-
|
|
12823
|
-
|
|
12824
|
-
|
|
12825
|
-
|
|
12826
|
-
|
|
12827
|
-
|
|
12828
|
-
|
|
12829
|
-
|
|
12830
|
-
|
|
12831
|
-
|
|
12832
|
-
},
|
|
12833
|
-
open: () => {
|
|
12834
|
-
},
|
|
12835
|
-
rename: () => {
|
|
12836
|
-
},
|
|
12837
|
-
close: () => {
|
|
12838
|
-
},
|
|
12839
|
-
write: () => {
|
|
12840
|
-
},
|
|
12841
|
-
writeAll: () => {
|
|
12842
|
-
},
|
|
12843
|
-
read: () => {
|
|
12844
|
-
},
|
|
12845
|
-
readUntil: () => {
|
|
12846
|
-
},
|
|
12847
|
-
readToEnd: () => {
|
|
12848
|
-
}
|
|
12852
|
+
writeFile: ASYNC_NOOP,
|
|
12853
|
+
removeFile: ASYNC_NOOP,
|
|
12854
|
+
mkdir: ASYNC_NOOP,
|
|
12855
|
+
mkdirp: ASYNC_NOOP,
|
|
12856
|
+
removeDirAll: ASYNC_NOOP,
|
|
12857
|
+
readDir: ASYNC_NOOP,
|
|
12858
|
+
readFile: ASYNC_NOOP,
|
|
12859
|
+
stat: ASYNC_NOOP,
|
|
12860
|
+
lstat: ASYNC_NOOP,
|
|
12861
|
+
open: ASYNC_NOOP,
|
|
12862
|
+
rename: ASYNC_NOOP,
|
|
12863
|
+
close: ASYNC_NOOP,
|
|
12864
|
+
write: ASYNC_NOOP,
|
|
12865
|
+
writeAll: ASYNC_NOOP,
|
|
12866
|
+
read: ASYNC_NOOP,
|
|
12867
|
+
readUntil: ASYNC_NOOP,
|
|
12868
|
+
readToEnd: ASYNC_NOOP
|
|
12849
12869
|
};
|
|
12850
12870
|
var ThreadsafeOutputNodeFS = class _ThreadsafeOutputNodeFS {
|
|
12851
12871
|
constructor(fs5) {
|
|
@@ -12870,15 +12890,7 @@ var ThreadsafeOutputNodeFS = class _ThreadsafeOutputNodeFS {
|
|
|
12870
12890
|
const statFn = import_node_util5.default.promisify(fs5.stat.bind(fs5));
|
|
12871
12891
|
return async (filePath) => {
|
|
12872
12892
|
const res = await statFn(filePath);
|
|
12873
|
-
return res &&
|
|
12874
|
-
isFile: res.isFile(),
|
|
12875
|
-
isDirectory: res.isDirectory(),
|
|
12876
|
-
atimeMs: res.atimeMs,
|
|
12877
|
-
mtimeMs: res.atimeMs,
|
|
12878
|
-
ctimeMs: res.atimeMs,
|
|
12879
|
-
birthtimeMs: res.birthtimeMs,
|
|
12880
|
-
size: res.size
|
|
12881
|
-
};
|
|
12893
|
+
return res && _ThreadsafeOutputNodeFS.__to_binding_stat(res);
|
|
12882
12894
|
};
|
|
12883
12895
|
});
|
|
12884
12896
|
this.lstat = memoizeFn(() => {
|
|
@@ -12896,6 +12908,7 @@ var ThreadsafeOutputNodeFS = class _ThreadsafeOutputNodeFS {
|
|
|
12896
12908
|
return {
|
|
12897
12909
|
isFile: stat.isFile(),
|
|
12898
12910
|
isDirectory: stat.isDirectory(),
|
|
12911
|
+
isSymlink: stat.isSymbolicLink(),
|
|
12899
12912
|
atimeMs: stat.atimeMs,
|
|
12900
12913
|
mtimeMs: stat.atimeMs,
|
|
12901
12914
|
ctimeMs: stat.atimeMs,
|
|
@@ -13067,6 +13080,9 @@ var Watching = class {
|
|
|
13067
13080
|
if (typeof this.watchOptions.aggregateTimeout !== "number") {
|
|
13068
13081
|
this.watchOptions.aggregateTimeout = 5;
|
|
13069
13082
|
}
|
|
13083
|
+
if (this.watchOptions.ignored === void 0) {
|
|
13084
|
+
this.watchOptions.ignored = /[\\/](?:\.git|node_modules)[\\/]/;
|
|
13085
|
+
}
|
|
13070
13086
|
process.nextTick(() => {
|
|
13071
13087
|
if (this.#initial) this.#invalidate();
|
|
13072
13088
|
});
|
|
@@ -13208,18 +13224,38 @@ var Watching = class {
|
|
|
13208
13224
|
this.invalid = false;
|
|
13209
13225
|
this.#invalidReported = false;
|
|
13210
13226
|
this.compiler.hooks.watchRun.callAsync(this.compiler, (err) => {
|
|
13211
|
-
if (err) return this._done(err
|
|
13227
|
+
if (err) return this._done(err);
|
|
13212
13228
|
const canRebuild = !this.#initial && ((modifiedFiles == null ? void 0 : modifiedFiles.size) || (deleteFiles == null ? void 0 : deleteFiles.size));
|
|
13213
|
-
const
|
|
13214
|
-
if (err2) return this._done(err2
|
|
13229
|
+
const onCompiled = (err2, _compilation) => {
|
|
13230
|
+
if (err2) return this._done(err2);
|
|
13231
|
+
const compilation = _compilation;
|
|
13232
|
+
const needAdditionalPass = compilation.hooks.needAdditionalPass.call();
|
|
13233
|
+
if (needAdditionalPass) {
|
|
13234
|
+
compilation.needAdditionalPass = true;
|
|
13235
|
+
compilation.startTime = this.startTime;
|
|
13236
|
+
compilation.endTime = Date.now();
|
|
13237
|
+
const stats = new Stats(compilation);
|
|
13238
|
+
this.compiler.hooks.done.callAsync(stats, (err3) => {
|
|
13239
|
+
if (err3) return this._done(err3, compilation);
|
|
13240
|
+
this.compiler.hooks.additionalPass.callAsync((err4) => {
|
|
13241
|
+
if (err4) return this._done(err4, compilation);
|
|
13242
|
+
this.compiler.compile(onCompiled);
|
|
13243
|
+
});
|
|
13244
|
+
});
|
|
13245
|
+
return;
|
|
13246
|
+
}
|
|
13215
13247
|
this._done(null, this.compiler._lastCompilation);
|
|
13216
13248
|
};
|
|
13217
|
-
this.compiler.compile(
|
|
13249
|
+
this.compiler.compile(onCompiled);
|
|
13218
13250
|
if (!canRebuild) {
|
|
13219
13251
|
this.#initial = false;
|
|
13220
13252
|
}
|
|
13221
13253
|
});
|
|
13222
13254
|
}
|
|
13255
|
+
/**
|
|
13256
|
+
* The reason why this is _done instead of #done, is that in Webpack,
|
|
13257
|
+
* it will rewrite this function to another function
|
|
13258
|
+
*/
|
|
13223
13259
|
_done(error, compilation) {
|
|
13224
13260
|
this.running = false;
|
|
13225
13261
|
let stats = void 0;
|
|
@@ -13288,7 +13324,7 @@ var Watching = class {
|
|
|
13288
13324
|
|
|
13289
13325
|
// src/util/bindingVersionCheck.ts
|
|
13290
13326
|
var import_node_fs3 = require("fs");
|
|
13291
|
-
var
|
|
13327
|
+
var import_node_path11 = __toESM(require("path"));
|
|
13292
13328
|
var NodePlatformArchToAbi = {
|
|
13293
13329
|
android: {
|
|
13294
13330
|
arm64: "",
|
|
@@ -13360,7 +13396,7 @@ var checkVersion = () => {
|
|
|
13360
13396
|
}
|
|
13361
13397
|
let ADDON_VERSION;
|
|
13362
13398
|
try {
|
|
13363
|
-
const BINDING_PKG_DIR =
|
|
13399
|
+
const BINDING_PKG_DIR = import_node_path11.default.dirname(
|
|
13364
13400
|
require.resolve("@rspack/binding/package.json")
|
|
13365
13401
|
);
|
|
13366
13402
|
const isLocal = (0, import_node_fs3.readdirSync)(BINDING_PKG_DIR).some(
|
|
@@ -13386,7 +13422,7 @@ var checkVersion = () => {
|
|
|
13386
13422
|
);
|
|
13387
13423
|
if (!isMatch) {
|
|
13388
13424
|
return result = new Error(
|
|
13389
|
-
|
|
13425
|
+
"Unmatched version @rspack/core@${CORE_VERSION}, @rspack/binding@${BINDING_VERSION}, @rspack/binding-${platformArchAbi}@${ADDON_VERSION}.\nRspack requires these versions to be the same or you may have installed the wrong version. Otherwise, rspack may not work properly."
|
|
13390
13426
|
);
|
|
13391
13427
|
}
|
|
13392
13428
|
return result = null;
|
|
@@ -13450,7 +13486,8 @@ var Compiler = class _Compiler {
|
|
|
13450
13486
|
beforeCompile: new liteTapable7.AsyncSeriesHook(["params"]),
|
|
13451
13487
|
afterCompile: new liteTapable7.AsyncSeriesHook(["compilation"]),
|
|
13452
13488
|
finishMake: new liteTapable7.AsyncSeriesHook(["compilation"]),
|
|
13453
|
-
entryOption: new liteTapable7.SyncBailHook(["context", "entry"])
|
|
13489
|
+
entryOption: new liteTapable7.SyncBailHook(["context", "entry"]),
|
|
13490
|
+
additionalPass: new liteTapable7.AsyncSeriesHook([])
|
|
13454
13491
|
};
|
|
13455
13492
|
this.webpack = rspack;
|
|
13456
13493
|
this.rspack = rspack;
|
|
@@ -13471,14 +13508,6 @@ var Compiler = class _Compiler {
|
|
|
13471
13508
|
this.watchMode = false;
|
|
13472
13509
|
new JsLoaderRspackPlugin(this).apply(this);
|
|
13473
13510
|
new ExecuteModulePlugin().apply(this);
|
|
13474
|
-
this.hooks.shutdown.tap("rspack:cleanup", () => {
|
|
13475
|
-
if (!this.running) {
|
|
13476
|
-
process.nextTick(() => {
|
|
13477
|
-
this.#instance = void 0;
|
|
13478
|
-
this.#compilation && (this.#compilation.__internal__shutdown = true);
|
|
13479
|
-
});
|
|
13480
|
-
}
|
|
13481
|
-
});
|
|
13482
13511
|
}
|
|
13483
13512
|
get recordsInputPath() {
|
|
13484
13513
|
return unsupported("Compiler.recordsInputPath");
|
|
@@ -13626,20 +13655,51 @@ var Compiler = class _Compiler {
|
|
|
13626
13655
|
}
|
|
13627
13656
|
const startTime = Date.now();
|
|
13628
13657
|
this.running = true;
|
|
13629
|
-
const
|
|
13630
|
-
|
|
13631
|
-
|
|
13632
|
-
|
|
13633
|
-
|
|
13634
|
-
|
|
13635
|
-
|
|
13636
|
-
|
|
13637
|
-
|
|
13638
|
-
|
|
13639
|
-
|
|
13658
|
+
const finalCallback = (err, stats) => {
|
|
13659
|
+
this.idle = true;
|
|
13660
|
+
this.cache.beginIdle();
|
|
13661
|
+
this.idle = true;
|
|
13662
|
+
this.running = false;
|
|
13663
|
+
if (err) {
|
|
13664
|
+
this.hooks.failed.call(err);
|
|
13665
|
+
}
|
|
13666
|
+
if (callback) {
|
|
13667
|
+
callback(err, stats);
|
|
13668
|
+
}
|
|
13669
|
+
this.hooks.afterDone.call(stats);
|
|
13670
|
+
};
|
|
13671
|
+
const onCompiled = (err, _compilation) => {
|
|
13672
|
+
if (err) {
|
|
13673
|
+
return finalCallback(err);
|
|
13674
|
+
}
|
|
13675
|
+
const compilation = _compilation;
|
|
13676
|
+
if (compilation.hooks.needAdditionalPass.call()) {
|
|
13677
|
+
compilation.needAdditionalPass = true;
|
|
13678
|
+
compilation.startTime = startTime;
|
|
13679
|
+
compilation.endTime = Date.now();
|
|
13680
|
+
const stats2 = new Stats(compilation);
|
|
13681
|
+
this.hooks.done.callAsync(stats2, (err2) => {
|
|
13682
|
+
if (err2) {
|
|
13683
|
+
return finalCallback(err2);
|
|
13684
|
+
}
|
|
13685
|
+
this.hooks.additionalPass.callAsync((err3) => {
|
|
13686
|
+
if (err3) return finalCallback(err3);
|
|
13687
|
+
this.compile(onCompiled);
|
|
13688
|
+
});
|
|
13689
|
+
});
|
|
13690
|
+
return;
|
|
13691
|
+
}
|
|
13692
|
+
compilation.startTime = startTime;
|
|
13693
|
+
compilation.endTime = Date.now();
|
|
13694
|
+
const stats = new Stats(compilation);
|
|
13695
|
+
this.hooks.done.callAsync(stats, (err2) => {
|
|
13696
|
+
if (err2) {
|
|
13697
|
+
return finalCallback(err2);
|
|
13640
13698
|
}
|
|
13641
|
-
|
|
13642
|
-
};
|
|
13699
|
+
return finalCallback(null, stats);
|
|
13700
|
+
});
|
|
13701
|
+
};
|
|
13702
|
+
const run = () => {
|
|
13643
13703
|
this.hooks.beforeRun.callAsync(this, (err) => {
|
|
13644
13704
|
if (err) {
|
|
13645
13705
|
return finalCallback(err);
|
|
@@ -13648,20 +13708,7 @@ var Compiler = class _Compiler {
|
|
|
13648
13708
|
if (err2) {
|
|
13649
13709
|
return finalCallback(err2);
|
|
13650
13710
|
}
|
|
13651
|
-
this.compile(
|
|
13652
|
-
if (err3) {
|
|
13653
|
-
return finalCallback(err3);
|
|
13654
|
-
}
|
|
13655
|
-
this.#compilation.startTime = startTime;
|
|
13656
|
-
this.#compilation.endTime = Date.now();
|
|
13657
|
-
const stats = new Stats(this.#compilation);
|
|
13658
|
-
this.hooks.done.callAsync(stats, (err4) => {
|
|
13659
|
-
if (err4) {
|
|
13660
|
-
return finalCallback(err4);
|
|
13661
|
-
}
|
|
13662
|
-
return finalCallback(null, stats);
|
|
13663
|
-
});
|
|
13664
|
-
});
|
|
13711
|
+
this.compile(onCompiled);
|
|
13665
13712
|
});
|
|
13666
13713
|
});
|
|
13667
13714
|
};
|
|
@@ -13669,10 +13716,10 @@ var Compiler = class _Compiler {
|
|
|
13669
13716
|
this.cache.endIdle((err) => {
|
|
13670
13717
|
if (err) return callback(err);
|
|
13671
13718
|
this.idle = false;
|
|
13672
|
-
|
|
13719
|
+
run();
|
|
13673
13720
|
});
|
|
13674
13721
|
} else {
|
|
13675
|
-
|
|
13722
|
+
run();
|
|
13676
13723
|
}
|
|
13677
13724
|
}
|
|
13678
13725
|
runAsChild(callback) {
|
|
@@ -14037,10 +14084,7 @@ var Compiler = class _Compiler {
|
|
|
14037
14084
|
runtimeRequirements
|
|
14038
14085
|
}) {
|
|
14039
14086
|
const set = __from_binding_runtime_globals(runtimeRequirements);
|
|
14040
|
-
queried.call(
|
|
14041
|
-
Chunk.__from_binding(chunk, that.deref().#compilation),
|
|
14042
|
-
set
|
|
14043
|
-
);
|
|
14087
|
+
queried.call(Chunk.__from_binding(chunk), set);
|
|
14044
14088
|
return {
|
|
14045
14089
|
runtimeRequirements: __to_binding_runtime_globals(set)
|
|
14046
14090
|
};
|
|
@@ -14054,14 +14098,11 @@ var Compiler = class _Compiler {
|
|
|
14054
14098
|
},
|
|
14055
14099
|
function(queried) {
|
|
14056
14100
|
return function({
|
|
14057
|
-
chunk:
|
|
14101
|
+
chunk: chunkBinding,
|
|
14058
14102
|
runtimeRequirements
|
|
14059
14103
|
}) {
|
|
14060
14104
|
const set = __from_binding_runtime_globals(runtimeRequirements);
|
|
14061
|
-
const chunk = Chunk.__from_binding(
|
|
14062
|
-
rawChunk,
|
|
14063
|
-
that.deref().#compilation
|
|
14064
|
-
);
|
|
14105
|
+
const chunk = Chunk.__from_binding(chunkBinding);
|
|
14065
14106
|
for (const r of set) {
|
|
14066
14107
|
queried.for(r).call(chunk, set);
|
|
14067
14108
|
}
|
|
@@ -14080,10 +14121,7 @@ var Compiler = class _Compiler {
|
|
|
14080
14121
|
return function({ module: module2, chunk }) {
|
|
14081
14122
|
var _a, _b;
|
|
14082
14123
|
const originSource = (_a = module2.source) == null ? void 0 : _a.source;
|
|
14083
|
-
queried.call(
|
|
14084
|
-
module2,
|
|
14085
|
-
Chunk.__from_binding(chunk, that.deref().#compilation)
|
|
14086
|
-
);
|
|
14124
|
+
queried.call(module2, Chunk.__from_binding(chunk));
|
|
14087
14125
|
const newSource = (_b = module2.source) == null ? void 0 : _b.source;
|
|
14088
14126
|
if (newSource && newSource !== originSource) {
|
|
14089
14127
|
return module2;
|
|
@@ -14143,54 +14181,59 @@ var Compiler = class _Compiler {
|
|
|
14143
14181
|
codegenResults,
|
|
14144
14182
|
runtimeModules
|
|
14145
14183
|
}) {
|
|
14146
|
-
|
|
14147
|
-
const
|
|
14148
|
-
|
|
14149
|
-
if (cached
|
|
14150
|
-
|
|
14151
|
-
|
|
14152
|
-
|
|
14153
|
-
|
|
14154
|
-
module: {
|
|
14184
|
+
try {
|
|
14185
|
+
const __webpack_require__ = (id2) => {
|
|
14186
|
+
const cached = moduleCache[id2];
|
|
14187
|
+
if (cached !== void 0) {
|
|
14188
|
+
if (cached.error) throw cached.error;
|
|
14189
|
+
return cached.exports;
|
|
14190
|
+
}
|
|
14191
|
+
const execOptions = {
|
|
14155
14192
|
id: id2,
|
|
14156
|
-
|
|
14157
|
-
|
|
14158
|
-
|
|
14159
|
-
|
|
14160
|
-
|
|
14193
|
+
module: {
|
|
14194
|
+
id: id2,
|
|
14195
|
+
exports: {},
|
|
14196
|
+
loaded: false,
|
|
14197
|
+
error: void 0
|
|
14198
|
+
},
|
|
14199
|
+
require: __webpack_require__
|
|
14200
|
+
};
|
|
14201
|
+
for (const handler of interceptModuleExecution) {
|
|
14202
|
+
handler(execOptions);
|
|
14203
|
+
}
|
|
14204
|
+
const result2 = codegenResults.map[id2]["build time"];
|
|
14205
|
+
const moduleObject = execOptions.module;
|
|
14206
|
+
if (id2) moduleCache[id2] = moduleObject;
|
|
14207
|
+
tryRunOrWebpackError(
|
|
14208
|
+
() => queried.call(
|
|
14209
|
+
{
|
|
14210
|
+
codeGenerationResult: new CodeGenerationResult(result2),
|
|
14211
|
+
moduleObject
|
|
14212
|
+
},
|
|
14213
|
+
{ __webpack_require__ }
|
|
14214
|
+
),
|
|
14215
|
+
"Compilation.hooks.executeModule"
|
|
14216
|
+
);
|
|
14217
|
+
moduleObject.loaded = true;
|
|
14218
|
+
return moduleObject.exports;
|
|
14161
14219
|
};
|
|
14162
|
-
|
|
14163
|
-
|
|
14220
|
+
const moduleCache = __webpack_require__[RuntimeGlobals.moduleCache.replace(
|
|
14221
|
+
`${RuntimeGlobals.require}.`,
|
|
14222
|
+
""
|
|
14223
|
+
)] = {};
|
|
14224
|
+
const interceptModuleExecution = __webpack_require__[RuntimeGlobals.interceptModuleExecution.replace(
|
|
14225
|
+
`${RuntimeGlobals.require}.`,
|
|
14226
|
+
""
|
|
14227
|
+
)] = [];
|
|
14228
|
+
for (const runtimeModule of runtimeModules) {
|
|
14229
|
+
__webpack_require__(runtimeModule);
|
|
14164
14230
|
}
|
|
14165
|
-
const
|
|
14166
|
-
|
|
14167
|
-
|
|
14168
|
-
|
|
14169
|
-
|
|
14170
|
-
{
|
|
14171
|
-
codeGenerationResult: new CodeGenerationResult(result2),
|
|
14172
|
-
moduleObject
|
|
14173
|
-
},
|
|
14174
|
-
{ __webpack_require__ }
|
|
14175
|
-
),
|
|
14176
|
-
"Compilation.hooks.executeModule"
|
|
14177
|
-
);
|
|
14178
|
-
moduleObject.loaded = true;
|
|
14179
|
-
return moduleObject.exports;
|
|
14180
|
-
};
|
|
14181
|
-
const moduleCache = __webpack_require__[RuntimeGlobals.moduleCache.replace(
|
|
14182
|
-
`${RuntimeGlobals.require}.`,
|
|
14183
|
-
""
|
|
14184
|
-
)] = {};
|
|
14185
|
-
const interceptModuleExecution = __webpack_require__[RuntimeGlobals.interceptModuleExecution.replace(
|
|
14186
|
-
`${RuntimeGlobals.require}.`,
|
|
14187
|
-
""
|
|
14188
|
-
)] = [];
|
|
14189
|
-
for (const runtimeModule of runtimeModules) {
|
|
14190
|
-
__webpack_require__(runtimeModule);
|
|
14231
|
+
const executeResult = __webpack_require__(entry2);
|
|
14232
|
+
that.deref().#moduleExecutionResultsMap.set(id, executeResult);
|
|
14233
|
+
} catch (e) {
|
|
14234
|
+
that.deref().#moduleExecutionResultsMap.set(id, e);
|
|
14235
|
+
throw e;
|
|
14191
14236
|
}
|
|
14192
|
-
const executeResult = __webpack_require__(entry2);
|
|
14193
|
-
that.deref().#moduleExecutionResultsMap.set(id, executeResult);
|
|
14194
14237
|
};
|
|
14195
14238
|
}
|
|
14196
14239
|
),
|
|
@@ -14266,10 +14309,7 @@ var Compiler = class _Compiler {
|
|
|
14266
14309
|
throw new Error("'output.hashFunction' cannot be undefined");
|
|
14267
14310
|
}
|
|
14268
14311
|
const hash = createHash(that.deref().options.output.hashFunction);
|
|
14269
|
-
queried.call(
|
|
14270
|
-
Chunk.__from_binding(chunk, that.deref().#compilation),
|
|
14271
|
-
hash
|
|
14272
|
-
);
|
|
14312
|
+
queried.call(Chunk.__from_binding(chunk), hash);
|
|
14273
14313
|
const digestResult = hash.digest(
|
|
14274
14314
|
that.deref().options.output.hashDigest
|
|
14275
14315
|
);
|
|
@@ -14284,10 +14324,7 @@ var Compiler = class _Compiler {
|
|
|
14284
14324
|
},
|
|
14285
14325
|
function(queried) {
|
|
14286
14326
|
return function({ chunk, filename: filename2 }) {
|
|
14287
|
-
return queried.call(
|
|
14288
|
-
Chunk.__from_binding(chunk, that.deref().#compilation),
|
|
14289
|
-
filename2
|
|
14290
|
-
);
|
|
14327
|
+
return queried.call(Chunk.__from_binding(chunk), filename2);
|
|
14291
14328
|
};
|
|
14292
14329
|
}
|
|
14293
14330
|
),
|
|
@@ -14500,10 +14537,7 @@ var Compiler = class _Compiler {
|
|
|
14500
14537
|
throw new Error("'output.hashFunction' cannot be undefined");
|
|
14501
14538
|
}
|
|
14502
14539
|
const hash = createHash(that.deref().options.output.hashFunction);
|
|
14503
|
-
queried.call(
|
|
14504
|
-
Chunk.__from_binding(chunk, that.deref().#compilation),
|
|
14505
|
-
hash
|
|
14506
|
-
);
|
|
14540
|
+
queried.call(Chunk.__from_binding(chunk), hash);
|
|
14507
14541
|
const digestResult = hash.digest(
|
|
14508
14542
|
that.deref().options.output.hashDigest
|
|
14509
14543
|
);
|
|
@@ -14626,11 +14660,12 @@ var Compiler = class _Compiler {
|
|
|
14626
14660
|
)
|
|
14627
14661
|
};
|
|
14628
14662
|
this.#instance = new instanceBinding.Rspack(
|
|
14663
|
+
this.compilerPath,
|
|
14629
14664
|
rawOptions,
|
|
14630
14665
|
this.#builtinPlugins,
|
|
14631
14666
|
this.#registers,
|
|
14632
14667
|
ThreadsafeOutputNodeFS.__to_binding(this.outputFileSystem),
|
|
14633
|
-
ThreadsafeIntermediateNodeFS.__to_binding(this.intermediateFileSystem),
|
|
14668
|
+
this.intermediateFileSystem ? ThreadsafeIntermediateNodeFS.__to_binding(this.intermediateFileSystem) : void 0,
|
|
14634
14669
|
ResolverFactory.__to_binding(this.resolverFactory)
|
|
14635
14670
|
);
|
|
14636
14671
|
callback(null, this.#instance);
|
|
@@ -15791,17 +15826,17 @@ var ASSETS_GROUPERS = {
|
|
|
15791
15826
|
const extensionMatch = groupAssetsByExtension && GROUP_EXTENSION_REGEXP.exec(asset.name);
|
|
15792
15827
|
const extension = extensionMatch ? extensionMatch[1] : "";
|
|
15793
15828
|
const pathMatch = groupAssetsByPath && GROUP_PATH_REGEXP.exec(asset.name);
|
|
15794
|
-
const
|
|
15829
|
+
const path11 = pathMatch ? pathMatch[1].split(/[/\\]/) : [];
|
|
15795
15830
|
const keys = [];
|
|
15796
15831
|
if (groupAssetsByPath) {
|
|
15797
15832
|
keys.push(".");
|
|
15798
15833
|
if (extension)
|
|
15799
15834
|
keys.push(
|
|
15800
|
-
|
|
15835
|
+
path11.length ? `${path11.join("/")}/*${extension}` : `*${extension}`
|
|
15801
15836
|
);
|
|
15802
|
-
while (
|
|
15803
|
-
keys.push(`${
|
|
15804
|
-
|
|
15837
|
+
while (path11.length > 0) {
|
|
15838
|
+
keys.push(`${path11.join("/")}/`);
|
|
15839
|
+
path11.pop();
|
|
15805
15840
|
}
|
|
15806
15841
|
} else {
|
|
15807
15842
|
if (extension) keys.push(`*${extension}`);
|
|
@@ -15987,16 +16022,16 @@ var MODULES_GROUPERS = (type) => ({
|
|
|
15987
16022
|
const extensionMatch = groupModulesByExtension && GROUP_EXTENSION_REGEXP.exec(resource);
|
|
15988
16023
|
const extension = extensionMatch ? extensionMatch[1] : "";
|
|
15989
16024
|
const pathMatch = groupModulesByPath && GROUP_PATH_REGEXP.exec(resource);
|
|
15990
|
-
const
|
|
16025
|
+
const path11 = pathMatch ? pathMatch[1].split(/[/\\]/) : [];
|
|
15991
16026
|
const keys = [];
|
|
15992
16027
|
if (groupModulesByPath) {
|
|
15993
16028
|
if (extension)
|
|
15994
16029
|
keys.push(
|
|
15995
|
-
|
|
16030
|
+
path11.length ? `${path11.join("/")}/*${extension}` : `*${extension}`
|
|
15996
16031
|
);
|
|
15997
|
-
while (
|
|
15998
|
-
keys.push(`${
|
|
15999
|
-
|
|
16032
|
+
while (path11.length > 0) {
|
|
16033
|
+
keys.push(`${path11.join("/")}/`);
|
|
16034
|
+
path11.pop();
|
|
16000
16035
|
}
|
|
16001
16036
|
} else {
|
|
16002
16037
|
if (extension) keys.push(`*${extension}`);
|
|
@@ -18497,6 +18532,7 @@ var RspackOptionsApply = class {
|
|
|
18497
18532
|
switch (chunkIds) {
|
|
18498
18533
|
case "natural": {
|
|
18499
18534
|
new NaturalChunkIdsPlugin().apply(compiler);
|
|
18535
|
+
break;
|
|
18500
18536
|
}
|
|
18501
18537
|
case "named": {
|
|
18502
18538
|
new NamedChunkIdsPlugin().apply(compiler);
|
|
@@ -18506,6 +18542,18 @@ var RspackOptionsApply = class {
|
|
|
18506
18542
|
new DeterministicChunkIdsPlugin().apply(compiler);
|
|
18507
18543
|
break;
|
|
18508
18544
|
}
|
|
18545
|
+
case "size": {
|
|
18546
|
+
new OccurrenceChunkIdsPlugin({
|
|
18547
|
+
prioritiseInitial: true
|
|
18548
|
+
}).apply(compiler);
|
|
18549
|
+
break;
|
|
18550
|
+
}
|
|
18551
|
+
case "total-size": {
|
|
18552
|
+
new OccurrenceChunkIdsPlugin({
|
|
18553
|
+
prioritiseInitial: false
|
|
18554
|
+
}).apply(compiler);
|
|
18555
|
+
break;
|
|
18556
|
+
}
|
|
18509
18557
|
default:
|
|
18510
18558
|
throw new Error(`chunkIds: ${chunkIds} is not implemented`);
|
|
18511
18559
|
}
|
|
@@ -18528,7 +18576,6 @@ var RspackOptionsApply = class {
|
|
|
18528
18576
|
if (options.performance) {
|
|
18529
18577
|
new SizeLimitsPlugin(options.performance).apply(compiler);
|
|
18530
18578
|
}
|
|
18531
|
-
new WarnCaseSensitiveModulesPlugin().apply(compiler);
|
|
18532
18579
|
if (options.cache) {
|
|
18533
18580
|
new MemoryCachePlugin().apply(compiler);
|
|
18534
18581
|
}
|
|
@@ -18595,9 +18642,9 @@ var matchObject = (obj, str) => {
|
|
|
18595
18642
|
var import_zod5 = __toESM(require("../compiled/zod/index.js"));
|
|
18596
18643
|
|
|
18597
18644
|
// src/builtin-plugin/FlagAllModulesAsUsedPlugin.ts
|
|
18598
|
-
var
|
|
18645
|
+
var import_binding75 = require("@rspack/binding");
|
|
18599
18646
|
var FlagAllModulesAsUsedPlugin = create2(
|
|
18600
|
-
|
|
18647
|
+
import_binding75.BuiltinPluginName.FlagAllModulesAsUsedPlugin,
|
|
18601
18648
|
(explanation) => {
|
|
18602
18649
|
return {
|
|
18603
18650
|
explanation
|
|
@@ -19460,7 +19507,7 @@ var NodeEnvironmentPlugin = class {
|
|
|
19460
19507
|
);
|
|
19461
19508
|
compiler.inputFileSystem = inputFileSystem;
|
|
19462
19509
|
compiler.outputFileSystem = import_graceful_fs2.default;
|
|
19463
|
-
compiler.intermediateFileSystem =
|
|
19510
|
+
compiler.intermediateFileSystem = null;
|
|
19464
19511
|
compiler.watchFileSystem = new NodeWatchFileSystem(inputFileSystem);
|
|
19465
19512
|
compiler.hooks.beforeRun.tap("NodeEnvironmentPlugin", (compiler2) => {
|
|
19466
19513
|
var _a;
|
|
@@ -19486,9 +19533,9 @@ var NodeTemplatePlugin = class {
|
|
|
19486
19533
|
};
|
|
19487
19534
|
|
|
19488
19535
|
// src/container/ModuleFederationRuntimePlugin.ts
|
|
19489
|
-
var
|
|
19536
|
+
var import_binding76 = require("@rspack/binding");
|
|
19490
19537
|
var ModuleFederationRuntimePlugin = create2(
|
|
19491
|
-
|
|
19538
|
+
import_binding76.BuiltinPluginName.ModuleFederationRuntimePlugin,
|
|
19492
19539
|
() => {
|
|
19493
19540
|
}
|
|
19494
19541
|
);
|
|
@@ -19684,10 +19731,10 @@ function getDefaultEntryRuntime(paths, options, compiler) {
|
|
|
19684
19731
|
}
|
|
19685
19732
|
|
|
19686
19733
|
// src/sharing/ConsumeSharedPlugin.ts
|
|
19687
|
-
var
|
|
19734
|
+
var import_binding78 = require("@rspack/binding");
|
|
19688
19735
|
|
|
19689
19736
|
// src/sharing/ShareRuntimePlugin.ts
|
|
19690
|
-
var
|
|
19737
|
+
var import_binding77 = require("@rspack/binding");
|
|
19691
19738
|
var compilerSet = /* @__PURE__ */ new WeakSet();
|
|
19692
19739
|
function isSingleton(compiler) {
|
|
19693
19740
|
return compilerSet.has(compiler);
|
|
@@ -19699,7 +19746,7 @@ var ShareRuntimePlugin = class extends RspackBuiltinPlugin {
|
|
|
19699
19746
|
constructor(enhanced = false) {
|
|
19700
19747
|
super();
|
|
19701
19748
|
this.enhanced = enhanced;
|
|
19702
|
-
this.name =
|
|
19749
|
+
this.name = import_binding77.BuiltinPluginName.ShareRuntimePlugin;
|
|
19703
19750
|
}
|
|
19704
19751
|
raw(compiler) {
|
|
19705
19752
|
if (isSingleton(compiler)) return;
|
|
@@ -19718,7 +19765,7 @@ function isRequiredVersion(str) {
|
|
|
19718
19765
|
var ConsumeSharedPlugin = class extends RspackBuiltinPlugin {
|
|
19719
19766
|
constructor(options) {
|
|
19720
19767
|
super();
|
|
19721
|
-
this.name =
|
|
19768
|
+
this.name = import_binding78.BuiltinPluginName.ConsumeSharedPlugin;
|
|
19722
19769
|
this._options = {
|
|
19723
19770
|
consumes: parseOptions(
|
|
19724
19771
|
options.consumes,
|
|
@@ -19781,11 +19828,11 @@ var ConsumeSharedPlugin = class extends RspackBuiltinPlugin {
|
|
|
19781
19828
|
};
|
|
19782
19829
|
|
|
19783
19830
|
// src/sharing/ProvideSharedPlugin.ts
|
|
19784
|
-
var
|
|
19831
|
+
var import_binding79 = require("@rspack/binding");
|
|
19785
19832
|
var ProvideSharedPlugin = class extends RspackBuiltinPlugin {
|
|
19786
19833
|
constructor(options) {
|
|
19787
19834
|
super();
|
|
19788
|
-
this.name =
|
|
19835
|
+
this.name = import_binding79.BuiltinPluginName.ProvideSharedPlugin;
|
|
19789
19836
|
this._provides = parseOptions(
|
|
19790
19837
|
options.provides,
|
|
19791
19838
|
(item) => {
|
|
@@ -19890,11 +19937,11 @@ var SharePlugin = class {
|
|
|
19890
19937
|
};
|
|
19891
19938
|
|
|
19892
19939
|
// src/container/ContainerPlugin.ts
|
|
19893
|
-
var
|
|
19940
|
+
var import_binding80 = require("@rspack/binding");
|
|
19894
19941
|
var ContainerPlugin = class extends RspackBuiltinPlugin {
|
|
19895
19942
|
constructor(options) {
|
|
19896
19943
|
super();
|
|
19897
|
-
this.name =
|
|
19944
|
+
this.name = import_binding80.BuiltinPluginName.ContainerPlugin;
|
|
19898
19945
|
this._options = {
|
|
19899
19946
|
name: options.name,
|
|
19900
19947
|
shareScope: options.shareScope || "default",
|
|
@@ -19927,7 +19974,7 @@ var ContainerPlugin = class extends RspackBuiltinPlugin {
|
|
|
19927
19974
|
const rawOptions = {
|
|
19928
19975
|
name: name2,
|
|
19929
19976
|
shareScope,
|
|
19930
|
-
library:
|
|
19977
|
+
library: library3,
|
|
19931
19978
|
runtime,
|
|
19932
19979
|
filename: filename2,
|
|
19933
19980
|
exposes: exposes.map(([key, r]) => ({ key, ...r })),
|
|
@@ -19938,11 +19985,11 @@ var ContainerPlugin = class extends RspackBuiltinPlugin {
|
|
|
19938
19985
|
};
|
|
19939
19986
|
|
|
19940
19987
|
// src/container/ContainerReferencePlugin.ts
|
|
19941
|
-
var
|
|
19988
|
+
var import_binding81 = require("@rspack/binding");
|
|
19942
19989
|
var ContainerReferencePlugin = class extends RspackBuiltinPlugin {
|
|
19943
19990
|
constructor(options) {
|
|
19944
19991
|
super();
|
|
19945
|
-
this.name =
|
|
19992
|
+
this.name = import_binding81.BuiltinPluginName.ContainerReferencePlugin;
|
|
19946
19993
|
this._options = {
|
|
19947
19994
|
remoteType: options.remoteType,
|
|
19948
19995
|
remotes: parseOptions(
|
|
@@ -20027,7 +20074,7 @@ var ModuleFederationPluginV1 = class {
|
|
|
20027
20074
|
};
|
|
20028
20075
|
|
|
20029
20076
|
// src/exports.ts
|
|
20030
|
-
var
|
|
20077
|
+
var import_binding82 = require("@rspack/binding");
|
|
20031
20078
|
var rspackVersion = import_package.version;
|
|
20032
20079
|
var version = import_package.webpackVersion;
|
|
20033
20080
|
var WebpackError2 = Error;
|
|
@@ -20073,8 +20120,8 @@ var sharing = {
|
|
|
20073
20120
|
};
|
|
20074
20121
|
var experiments2 = {
|
|
20075
20122
|
globalTrace: {
|
|
20076
|
-
register:
|
|
20077
|
-
cleanup:
|
|
20123
|
+
register: import_binding82.registerGlobalTrace,
|
|
20124
|
+
cleanup: import_binding82.cleanupGlobalTrace
|
|
20078
20125
|
},
|
|
20079
20126
|
RemoveDuplicateModulesPlugin
|
|
20080
20127
|
};
|
|
@@ -20226,6 +20273,7 @@ module.exports = rspack;
|
|
|
20226
20273
|
SwcJsMinimizerRspackPlugin,
|
|
20227
20274
|
Template,
|
|
20228
20275
|
ValidationError,
|
|
20276
|
+
WarnCaseSensitiveModulesPlugin,
|
|
20229
20277
|
WebpackError,
|
|
20230
20278
|
WebpackOptionsApply,
|
|
20231
20279
|
config,
|