@rspack/core 2.0.3 → 2.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/builtin-plugin/CircularModulesInfoPlugin.d.ts +7 -0
- package/dist/builtin-plugin/CssHttpExternalsRspackPlugin.d.ts +9 -0
- package/dist/builtin-plugin/ExternalsPlugin.d.ts +2 -1
- package/dist/builtin-plugin/HttpExternalsRspackPlugin.d.ts +2 -2
- package/dist/builtin-plugin/index.d.ts +2 -0
- package/dist/config/target.d.ts +2 -0
- package/dist/config/types.d.ts +66 -20
- package/dist/index.js +131 -45
- package/module.d.ts +20 -0
- package/package.json +7 -7
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type BuiltinPlugin, BuiltinPluginName } from '@rspack/binding';
|
|
2
|
+
import type { Compiler } from '../Compiler.js';
|
|
3
|
+
import { RspackBuiltinPlugin } from './base.js';
|
|
4
|
+
export declare class CircularModulesInfoPlugin extends RspackBuiltinPlugin {
|
|
5
|
+
name: BuiltinPluginName;
|
|
6
|
+
raw(_compiler: Compiler): BuiltinPlugin;
|
|
7
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const CssHttpExternalsRspackPlugin: {
|
|
2
|
+
new (): {
|
|
3
|
+
name: string;
|
|
4
|
+
_args: [];
|
|
5
|
+
affectedHooks: keyof import("../index.js").CompilerHooks | undefined;
|
|
6
|
+
raw(compiler: import("../index.js").Compiler): import("@rspack/binding").BuiltinPlugin;
|
|
7
|
+
apply(compiler: import("../index.js").Compiler): void;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
@@ -6,7 +6,8 @@ export declare class ExternalsPlugin extends RspackBuiltinPlugin {
|
|
|
6
6
|
private type;
|
|
7
7
|
private externals;
|
|
8
8
|
private placeInInitial?;
|
|
9
|
+
private fallbackType?;
|
|
9
10
|
name: BuiltinPluginName;
|
|
10
|
-
constructor(type: string, externals: Externals, placeInInitial?: boolean | undefined);
|
|
11
|
+
constructor(type: string, externals: Externals, placeInInitial?: boolean | undefined, fallbackType?: string | undefined);
|
|
11
12
|
raw(): BuiltinPlugin | undefined;
|
|
12
13
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const HttpExternalsRspackPlugin: {
|
|
2
|
-
new (
|
|
2
|
+
new (webAsync: boolean): {
|
|
3
3
|
name: string;
|
|
4
|
-
_args: [
|
|
4
|
+
_args: [webAsync: boolean];
|
|
5
5
|
affectedHooks: keyof import("../index.js").CompilerHooks | undefined;
|
|
6
6
|
raw(compiler: import("../index.js").Compiler): import("@rspack/binding").BuiltinPlugin;
|
|
7
7
|
apply(compiler: import("../index.js").Compiler): void;
|
|
@@ -7,11 +7,13 @@ export * from './BundlerInfoRspackPlugin.js';
|
|
|
7
7
|
export { createNativePlugin, RspackBuiltinPlugin } from './base.js';
|
|
8
8
|
export * from './CaseSensitivePlugin.js';
|
|
9
9
|
export * from './ChunkPrefetchPreloadPlugin.js';
|
|
10
|
+
export * from './CircularModulesInfoPlugin.js';
|
|
10
11
|
export * from './CircularDependencyRspackPlugin.js';
|
|
11
12
|
export * from './CommonJsChunkFormatPlugin.js';
|
|
12
13
|
export * from './ContextReplacementPlugin.js';
|
|
13
14
|
export * from './CopyRspackPlugin.js';
|
|
14
15
|
export * from './CssChunkingPlugin.js';
|
|
16
|
+
export * from './CssHttpExternalsRspackPlugin.js';
|
|
15
17
|
export * from './CssModulesPlugin.js';
|
|
16
18
|
export * from './css-extract/index.js';
|
|
17
19
|
export * from './DataUriPlugin.js';
|
package/dist/config/target.d.ts
CHANGED
|
@@ -61,6 +61,8 @@ export type EcmaTargetProperties = {
|
|
|
61
61
|
bigIntLiteral: boolean | null;
|
|
62
62
|
/** const and let variable declarations are available */
|
|
63
63
|
const: boolean | null;
|
|
64
|
+
/** computed property names in object literals are available */
|
|
65
|
+
computedProperty: boolean | null;
|
|
64
66
|
/** method shorthand in object is available */
|
|
65
67
|
methodShorthand: boolean | null;
|
|
66
68
|
/** arrow functions are available */
|
package/dist/config/types.d.ts
CHANGED
|
@@ -268,6 +268,8 @@ export type Environment = {
|
|
|
268
268
|
bigIntLiteral?: boolean;
|
|
269
269
|
/** The environment supports const and let for variable declarations. */
|
|
270
270
|
const?: boolean;
|
|
271
|
+
/** The environment supports computed property names in object literals ('{ [expr]: value }'). */
|
|
272
|
+
computedProperty?: boolean;
|
|
271
273
|
/** The environment supports destructuring ('{ a, b } = obj'). */
|
|
272
274
|
destructuring?: boolean;
|
|
273
275
|
/** The environment supports 'document' variable. */
|
|
@@ -756,27 +758,29 @@ export type CssParserOptions = {
|
|
|
756
758
|
* Allow to enable/disables `@import` at-rules handling.
|
|
757
759
|
* @default true
|
|
758
760
|
* */
|
|
759
|
-
|
|
760
|
-
};
|
|
761
|
-
/** Options object for `css/auto` modules. */
|
|
762
|
-
export type CssAutoParserOptions = {
|
|
761
|
+
import?: boolean;
|
|
763
762
|
/**
|
|
764
|
-
*
|
|
763
|
+
* Allow to enable/disables `@import` at-rules handling.
|
|
765
764
|
* @default true
|
|
766
765
|
* */
|
|
767
|
-
|
|
766
|
+
resolveImport?: CssParserResolveImport;
|
|
768
767
|
/**
|
|
769
|
-
*
|
|
768
|
+
* Enable/disable renaming of `@keyframes`.
|
|
770
769
|
* @default true
|
|
771
|
-
|
|
772
|
-
|
|
770
|
+
*/
|
|
771
|
+
animation?: boolean;
|
|
773
772
|
/**
|
|
774
|
-
*
|
|
775
|
-
* @default
|
|
776
|
-
|
|
777
|
-
|
|
773
|
+
* Enable/disable renaming of custom identifiers.
|
|
774
|
+
* @default false
|
|
775
|
+
*/
|
|
776
|
+
customIdents?: boolean;
|
|
777
|
+
/**
|
|
778
|
+
* Enable/disable renaming of dashed identifiers, e.g. custom properties.
|
|
779
|
+
* @default false
|
|
780
|
+
*/
|
|
781
|
+
dashedIdents?: boolean;
|
|
778
782
|
};
|
|
779
|
-
/** Options object for `css/module` modules. */
|
|
783
|
+
/** Options object for `css/auto`, `css/global` and `css/module` modules. */
|
|
780
784
|
export type CssModuleParserOptions = {
|
|
781
785
|
/**
|
|
782
786
|
* Use ES modules named export for CSS exports.
|
|
@@ -792,7 +796,27 @@ export type CssModuleParserOptions = {
|
|
|
792
796
|
* Allow to enable/disables `@import` at-rules handling.
|
|
793
797
|
* @default true
|
|
794
798
|
* */
|
|
799
|
+
import?: boolean;
|
|
800
|
+
/**
|
|
801
|
+
* Allow to filter handling of `@import` at-rules.
|
|
802
|
+
* @default true
|
|
803
|
+
* */
|
|
795
804
|
resolveImport?: CssParserResolveImport;
|
|
805
|
+
/**
|
|
806
|
+
* Enable/disable renaming of `@keyframes`.
|
|
807
|
+
* @default true
|
|
808
|
+
*/
|
|
809
|
+
animation?: boolean;
|
|
810
|
+
/**
|
|
811
|
+
* Enable/disable renaming of custom identifiers.
|
|
812
|
+
* @default false
|
|
813
|
+
*/
|
|
814
|
+
customIdents?: boolean;
|
|
815
|
+
/**
|
|
816
|
+
* Enable/disable renaming of dashed identifiers, e.g. custom properties.
|
|
817
|
+
* @default false
|
|
818
|
+
*/
|
|
819
|
+
dashedIdents?: boolean;
|
|
796
820
|
};
|
|
797
821
|
type ExportsPresence = 'error' | 'warn' | 'auto' | false;
|
|
798
822
|
export type JavascriptParserCommonjsExports = boolean | 'skipInEsm';
|
|
@@ -936,7 +960,9 @@ export type ParserOptionsByModuleTypeKnown = {
|
|
|
936
960
|
/** Parser options for `css` modules. */
|
|
937
961
|
css?: CssParserOptions;
|
|
938
962
|
/** Parser options for `css/auto` modules. */
|
|
939
|
-
'css/auto'?:
|
|
963
|
+
'css/auto'?: CssModuleParserOptions;
|
|
964
|
+
/** Parser options for `css/global` modules. */
|
|
965
|
+
'css/global'?: CssModuleParserOptions;
|
|
940
966
|
/** Parser options for `css/module` modules. */
|
|
941
967
|
'css/module'?: CssModuleParserOptions;
|
|
942
968
|
/** Parser options for `javascript` modules. */
|
|
@@ -1014,6 +1040,10 @@ export type CssGeneratorExportsConvention = 'as-is' | 'camel-case' | 'camel-case
|
|
|
1014
1040
|
export type CssGeneratorExportsOnly = boolean;
|
|
1015
1041
|
export type CssGeneratorLocalIdentName = string;
|
|
1016
1042
|
export type CssGeneratorEsModule = boolean;
|
|
1043
|
+
export type CssGeneratorLocalIdentHashDigest = string;
|
|
1044
|
+
export type CssGeneratorLocalIdentHashDigestLength = number;
|
|
1045
|
+
export type CssGeneratorLocalIdentHashFunction = string;
|
|
1046
|
+
export type CssGeneratorLocalIdentHashSalt = string;
|
|
1017
1047
|
/** Generator options for css modules. */
|
|
1018
1048
|
export type CssGeneratorOptions = {
|
|
1019
1049
|
/**
|
|
@@ -1024,8 +1054,8 @@ export type CssGeneratorOptions = {
|
|
|
1024
1054
|
/** This configuration is available for improved ESM-CJS interoperability purposes. */
|
|
1025
1055
|
esModule?: CssGeneratorEsModule;
|
|
1026
1056
|
};
|
|
1027
|
-
/** Generator options for css/auto modules. */
|
|
1028
|
-
export type
|
|
1057
|
+
/** Generator options for css/auto, css/global and css/module modules. */
|
|
1058
|
+
export type CssModuleGeneratorOptions = {
|
|
1029
1059
|
/**
|
|
1030
1060
|
* Customize how CSS export names are exported to javascript modules
|
|
1031
1061
|
* @default 'as-is'
|
|
@@ -1036,13 +1066,27 @@ export type CssAutoGeneratorOptions = {
|
|
|
1036
1066
|
* If false, generate stylesheets and embed them in the template.
|
|
1037
1067
|
*/
|
|
1038
1068
|
exportsOnly?: CssGeneratorExportsOnly;
|
|
1069
|
+
/**
|
|
1070
|
+
* Digest types used for the hash.
|
|
1071
|
+
*/
|
|
1072
|
+
localIdentHashDigest?: CssGeneratorLocalIdentHashDigest;
|
|
1073
|
+
/**
|
|
1074
|
+
* Number of chars which are used for the hash.
|
|
1075
|
+
*/
|
|
1076
|
+
localIdentHashDigestLength?: CssGeneratorLocalIdentHashDigestLength;
|
|
1077
|
+
/**
|
|
1078
|
+
* Algorithm used for generation the hash.
|
|
1079
|
+
*/
|
|
1080
|
+
localIdentHashFunction?: CssGeneratorLocalIdentHashFunction;
|
|
1081
|
+
/**
|
|
1082
|
+
* Any string which is added to the hash to salt it.
|
|
1083
|
+
*/
|
|
1084
|
+
localIdentHashSalt?: CssGeneratorLocalIdentHashSalt;
|
|
1039
1085
|
/** Customize the format of the local class names generated for CSS modules */
|
|
1040
1086
|
localIdentName?: CssGeneratorLocalIdentName;
|
|
1041
1087
|
/** This configuration is available for improved ESM-CJS interoperability purposes. */
|
|
1042
1088
|
esModule?: CssGeneratorEsModule;
|
|
1043
1089
|
};
|
|
1044
|
-
/** Generator options for css/module modules. */
|
|
1045
|
-
export type CssModuleGeneratorOptions = CssAutoGeneratorOptions;
|
|
1046
1090
|
/** Generator options for json modules. */
|
|
1047
1091
|
export type JsonGeneratorOptions = {
|
|
1048
1092
|
/**
|
|
@@ -1061,7 +1105,9 @@ export type GeneratorOptionsByModuleTypeKnown = {
|
|
|
1061
1105
|
/** Generator options for css modules. */
|
|
1062
1106
|
css?: CssGeneratorOptions;
|
|
1063
1107
|
/** Generator options for css/auto modules. */
|
|
1064
|
-
'css/auto'?:
|
|
1108
|
+
'css/auto'?: CssModuleGeneratorOptions;
|
|
1109
|
+
/** Generator options for css/global modules. */
|
|
1110
|
+
'css/global'?: CssModuleGeneratorOptions;
|
|
1065
1111
|
/** Generator options for css/module modules. */
|
|
1066
1112
|
'css/module'?: CssModuleGeneratorOptions;
|
|
1067
1113
|
/** Generator options for json modules. */
|
package/dist/index.js
CHANGED
|
@@ -34,7 +34,7 @@ __webpack_require__.m = __webpack_modules__, __webpack_require__.n = (module)=>{
|
|
|
34
34
|
value: !0
|
|
35
35
|
});
|
|
36
36
|
}, __webpack_require__.add({
|
|
37
|
-
"../../node_modules/.pnpm/enhanced-resolve@5.21.
|
|
37
|
+
"../../node_modules/.pnpm/enhanced-resolve@5.21.3/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
38
38
|
let { nextTick } = __webpack_require__("process"), dirname = (path)=>{
|
|
39
39
|
let idx = path.length - 1;
|
|
40
40
|
for(; idx >= 0;){
|
|
@@ -2484,6 +2484,12 @@ let INTERNAL_PLUGIN_NAMES = Object.keys(binding_default().BuiltinPluginName), AP
|
|
|
2484
2484
|
bundler: options.bundler || 'rspack',
|
|
2485
2485
|
force: options.force ?? !1
|
|
2486
2486
|
})), CaseSensitivePlugin = base_create(binding_namespaceObject.BuiltinPluginName.CaseSensitivePlugin, ()=>{}, 'compilation'), ChunkPrefetchPreloadPlugin = base_create(binding_namespaceObject.BuiltinPluginName.ChunkPrefetchPreloadPlugin, ()=>{});
|
|
2487
|
+
class CircularModulesInfoPlugin extends RspackBuiltinPlugin {
|
|
2488
|
+
name = binding_namespaceObject.BuiltinPluginName.CircularModulesInfoPlugin;
|
|
2489
|
+
raw(_compiler) {
|
|
2490
|
+
return createBuiltinPlugin(this.name, void 0);
|
|
2491
|
+
}
|
|
2492
|
+
}
|
|
2487
2493
|
class CircularDependencyRspackPlugin extends RspackBuiltinPlugin {
|
|
2488
2494
|
name = binding_namespaceObject.BuiltinPluginName.CircularDependencyRspackPlugin;
|
|
2489
2495
|
_options;
|
|
@@ -2546,7 +2552,7 @@ let CommonJsChunkFormatPlugin = base_create(binding_namespaceObject.BuiltinPlugi
|
|
|
2546
2552
|
cssIndex && splitChunks.defaultSizeTypes.splice(cssIndex, 1);
|
|
2547
2553
|
}
|
|
2548
2554
|
return options;
|
|
2549
|
-
}), CssModulesPlugin = base_create(binding_namespaceObject.BuiltinPluginName.CssModulesPlugin, ()=>{}, 'compilation'), DEFAULT_FILENAME = '[name].css', LOADER_PATH = join(import.meta.dirname, 'cssExtractLoader.js');
|
|
2555
|
+
}), CssHttpExternalsRspackPlugin = base_create(binding_namespaceObject.BuiltinPluginName.CssHttpExternalsRspackPlugin, ()=>void 0), CssModulesPlugin = base_create(binding_namespaceObject.BuiltinPluginName.CssModulesPlugin, ()=>{}, 'compilation'), DEFAULT_FILENAME = '[name].css', LOADER_PATH = join(import.meta.dirname, 'cssExtractLoader.js');
|
|
2550
2556
|
class CssExtractRspackPlugin {
|
|
2551
2557
|
static pluginName = 'css-extract-rspack-plugin';
|
|
2552
2558
|
static loader = LOADER_PATH;
|
|
@@ -2613,8 +2619,7 @@ let DllEntryPlugin = base_create(binding_namespaceObject.BuiltinPluginName.DllEn
|
|
|
2613
2619
|
context,
|
|
2614
2620
|
entries,
|
|
2615
2621
|
name: options.name
|
|
2616
|
-
})), DllReferenceAgencyPlugin = base_create(binding_namespaceObject.BuiltinPluginName.DllReferenceAgencyPlugin, (options)=>options)
|
|
2617
|
-
class EntryOptionPlugin {
|
|
2622
|
+
})), DllReferenceAgencyPlugin = base_create(binding_namespaceObject.BuiltinPluginName.DllReferenceAgencyPlugin, (options)=>options), lib_EntryOptionPlugin = class EntryOptionPlugin {
|
|
2618
2623
|
apply(compiler) {
|
|
2619
2624
|
compiler.hooks.entryOption.tap('EntryOptionPlugin', (context, entry)=>(EntryOptionPlugin.applyEntryOption(compiler, context, entry), !0));
|
|
2620
2625
|
}
|
|
@@ -2640,8 +2645,7 @@ class EntryOptionPlugin {
|
|
|
2640
2645
|
library: desc.library
|
|
2641
2646
|
};
|
|
2642
2647
|
}
|
|
2643
|
-
}
|
|
2644
|
-
let lib_EntryOptionPlugin = EntryOptionPlugin, EntryPlugin = base_create(binding_namespaceObject.BuiltinPluginName.EntryPlugin, (context, entry, options = '')=>({
|
|
2648
|
+
}, EntryPlugin = base_create(binding_namespaceObject.BuiltinPluginName.EntryPlugin, (context, entry, options = '')=>({
|
|
2645
2649
|
context,
|
|
2646
2650
|
entry,
|
|
2647
2651
|
options: getRawEntryOptions('string' == typeof options ? {
|
|
@@ -4405,7 +4409,7 @@ function getRawRuleSetCondition(condition) {
|
|
|
4405
4409
|
throw Error('unreachable: condition should be one of string, RegExp, Array, Object');
|
|
4406
4410
|
}
|
|
4407
4411
|
function getRawParserOptions(parser, type) {
|
|
4408
|
-
var parser1, parser2;
|
|
4412
|
+
var parser1, parser2, parser3;
|
|
4409
4413
|
if ('asset' === type) {
|
|
4410
4414
|
return {
|
|
4411
4415
|
type: 'asset',
|
|
@@ -4438,14 +4442,28 @@ function getRawParserOptions(parser, type) {
|
|
|
4438
4442
|
type: "javascript/esm",
|
|
4439
4443
|
javascript: getRawJavascriptParserOptions(parser)
|
|
4440
4444
|
};
|
|
4441
|
-
if ('css' === type)
|
|
4442
|
-
|
|
4443
|
-
|
|
4444
|
-
|
|
4445
|
+
if ('css' === type) {
|
|
4446
|
+
return {
|
|
4447
|
+
type: 'css',
|
|
4448
|
+
css: {
|
|
4449
|
+
namedExports: (parser2 = parser).namedExports,
|
|
4450
|
+
url: parser2.url,
|
|
4451
|
+
import: parser2.import,
|
|
4452
|
+
resolveImport: parser2.resolveImport,
|
|
4453
|
+
animation: parser2.animation,
|
|
4454
|
+
customIdents: parser2.customIdents,
|
|
4455
|
+
dashedIdents: parser2.dashedIdents
|
|
4456
|
+
}
|
|
4457
|
+
};
|
|
4458
|
+
}
|
|
4445
4459
|
if ('css/auto' === type) return {
|
|
4446
4460
|
type: 'css/auto',
|
|
4447
4461
|
cssAuto: getRawCssParserOptions(parser)
|
|
4448
4462
|
};
|
|
4463
|
+
if ('css/global' === type) return {
|
|
4464
|
+
type: 'css/global',
|
|
4465
|
+
cssGlobal: getRawCssParserOptions(parser)
|
|
4466
|
+
};
|
|
4449
4467
|
if ('css/module' === type) return {
|
|
4450
4468
|
type: 'css/module',
|
|
4451
4469
|
cssModule: getRawCssParserOptions(parser)
|
|
@@ -4454,8 +4472,8 @@ function getRawParserOptions(parser, type) {
|
|
|
4454
4472
|
return {
|
|
4455
4473
|
type: 'json',
|
|
4456
4474
|
json: {
|
|
4457
|
-
exportsDepth: (
|
|
4458
|
-
parse: 'function' == typeof
|
|
4475
|
+
exportsDepth: (parser3 = parser).exportsDepth,
|
|
4476
|
+
parse: 'function' == typeof parser3.parse ? (str)=>JSON.stringify(parser3.parse(str)) : void 0
|
|
4459
4477
|
}
|
|
4460
4478
|
};
|
|
4461
4479
|
}
|
|
@@ -4499,7 +4517,11 @@ function getRawCssParserOptions(parser) {
|
|
|
4499
4517
|
return {
|
|
4500
4518
|
namedExports: parser.namedExports,
|
|
4501
4519
|
url: parser.url,
|
|
4502
|
-
|
|
4520
|
+
import: parser.import,
|
|
4521
|
+
resolveImport: parser.resolveImport,
|
|
4522
|
+
animation: parser.animation,
|
|
4523
|
+
customIdents: parser.customIdents,
|
|
4524
|
+
dashedIdents: parser.dashedIdents
|
|
4503
4525
|
};
|
|
4504
4526
|
}
|
|
4505
4527
|
function getRawGeneratorOptions(generator, type) {
|
|
@@ -4534,6 +4556,10 @@ function getRawGeneratorOptions(generator, type) {
|
|
|
4534
4556
|
type: 'css/auto',
|
|
4535
4557
|
cssAuto: getRawCssAutoOrModuleGeneratorOptions(generator)
|
|
4536
4558
|
};
|
|
4559
|
+
if ('css/global' === type) return {
|
|
4560
|
+
type: 'css/global',
|
|
4561
|
+
cssGlobal: getRawCssAutoOrModuleGeneratorOptions(generator)
|
|
4562
|
+
};
|
|
4537
4563
|
if ('css/module' === type) return {
|
|
4538
4564
|
type: 'css/module',
|
|
4539
4565
|
cssModule: getRawCssAutoOrModuleGeneratorOptions(generator)
|
|
@@ -4579,6 +4605,10 @@ function getRawAssetResourceGeneratorOptions(options) {
|
|
|
4579
4605
|
function getRawCssAutoOrModuleGeneratorOptions(options) {
|
|
4580
4606
|
return {
|
|
4581
4607
|
localIdentName: options.localIdentName,
|
|
4608
|
+
localIdentHashDigest: options.localIdentHashDigest,
|
|
4609
|
+
localIdentHashDigestLength: options.localIdentHashDigestLength,
|
|
4610
|
+
localIdentHashFunction: options.localIdentHashFunction,
|
|
4611
|
+
localIdentHashSalt: options.localIdentHashSalt,
|
|
4582
4612
|
exportsConvention: options.exportsConvention,
|
|
4583
4613
|
exportsOnly: options.exportsOnly,
|
|
4584
4614
|
esModule: options.esModule
|
|
@@ -4588,14 +4618,16 @@ class ExternalsPlugin extends RspackBuiltinPlugin {
|
|
|
4588
4618
|
type;
|
|
4589
4619
|
externals;
|
|
4590
4620
|
placeInInitial;
|
|
4621
|
+
fallbackType;
|
|
4591
4622
|
name = binding_namespaceObject.BuiltinPluginName.ExternalsPlugin;
|
|
4592
4623
|
#resolveRequestCache = new Map();
|
|
4593
|
-
constructor(type, externals, placeInInitial){
|
|
4594
|
-
super(), this.type = type, this.externals = externals, this.placeInInitial = placeInInitial;
|
|
4624
|
+
constructor(type, externals, placeInInitial, fallbackType){
|
|
4625
|
+
super(), this.type = type, this.externals = externals, this.placeInInitial = placeInInitial, this.fallbackType = fallbackType;
|
|
4595
4626
|
}
|
|
4596
4627
|
raw() {
|
|
4597
4628
|
let type = this.type, externals = this.externals, raw = {
|
|
4598
4629
|
type,
|
|
4630
|
+
fallbackType: this.fallbackType,
|
|
4599
4631
|
externals: (Array.isArray(externals) ? externals : [
|
|
4600
4632
|
externals
|
|
4601
4633
|
]).filter(Boolean).map((item)=>this.#getRawExternalItem(item)),
|
|
@@ -4699,8 +4731,7 @@ class HotModuleReplacementPlugin extends RspackBuiltinPlugin {
|
|
|
4699
4731
|
return void 0 === compiler.options.output.strictModuleErrorHandling && (compiler.options.output.strictModuleErrorHandling = !0), createBuiltinPlugin(this.name, void 0);
|
|
4700
4732
|
}
|
|
4701
4733
|
}
|
|
4702
|
-
let HttpExternalsRspackPlugin = base_create(binding_namespaceObject.BuiltinPluginName.HttpExternalsRspackPlugin, (
|
|
4703
|
-
css,
|
|
4734
|
+
let HttpExternalsRspackPlugin = base_create(binding_namespaceObject.BuiltinPluginName.HttpExternalsRspackPlugin, (webAsync)=>({
|
|
4704
4735
|
webAsync
|
|
4705
4736
|
})), HttpUriPlugin_require = createRequire(import.meta.url), getHttp = memoize(()=>HttpUriPlugin_require('node:http')), getHttps = memoize(()=>HttpUriPlugin_require('node:https')), defaultHttpClientForNode = async (url, headers)=>{
|
|
4706
4737
|
let { res, body } = await function(url, options) {
|
|
@@ -5917,6 +5948,35 @@ let configCache = {}, ES_VERSIONS_MAP = {
|
|
|
5917
5948
|
9
|
|
5918
5949
|
]
|
|
5919
5950
|
}),
|
|
5951
|
+
computedProperty: rawChecker({
|
|
5952
|
+
chrome: 47,
|
|
5953
|
+
and_chr: 47,
|
|
5954
|
+
edge: 12,
|
|
5955
|
+
firefox: 34,
|
|
5956
|
+
and_ff: 34,
|
|
5957
|
+
opera: 34,
|
|
5958
|
+
op_mob: 34,
|
|
5959
|
+
safari: 8,
|
|
5960
|
+
ios_saf: 8,
|
|
5961
|
+
samsung: 5,
|
|
5962
|
+
android: 47,
|
|
5963
|
+
and_qq: [
|
|
5964
|
+
14,
|
|
5965
|
+
9
|
|
5966
|
+
],
|
|
5967
|
+
and_uc: [
|
|
5968
|
+
15,
|
|
5969
|
+
5
|
|
5970
|
+
],
|
|
5971
|
+
kaios: [
|
|
5972
|
+
2,
|
|
5973
|
+
5
|
|
5974
|
+
],
|
|
5975
|
+
node: [
|
|
5976
|
+
4,
|
|
5977
|
+
0
|
|
5978
|
+
]
|
|
5979
|
+
}),
|
|
5920
5980
|
arrowFunction: rawChecker({
|
|
5921
5981
|
chrome: 45,
|
|
5922
5982
|
and_chr: 45,
|
|
@@ -6364,6 +6424,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
6364
6424
|
importScriptsInWorker: !1,
|
|
6365
6425
|
globalThis: v(12),
|
|
6366
6426
|
const: v(6),
|
|
6427
|
+
computedProperty: v(4),
|
|
6367
6428
|
templateLiteral: v(4),
|
|
6368
6429
|
optionalChaining: v(14),
|
|
6369
6430
|
methodShorthand: v(4),
|
|
@@ -6409,6 +6470,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
6409
6470
|
importScriptsInWorker: !0,
|
|
6410
6471
|
globalThis: v(5),
|
|
6411
6472
|
const: v(1, 1),
|
|
6473
|
+
computedProperty: v(1, 1),
|
|
6412
6474
|
templateLiteral: v(1, 1),
|
|
6413
6475
|
optionalChaining: v(8),
|
|
6414
6476
|
methodShorthand: v(1, 1),
|
|
@@ -6449,6 +6511,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
6449
6511
|
require: !1,
|
|
6450
6512
|
globalThis: v(0, 43),
|
|
6451
6513
|
const: v(0, 15),
|
|
6514
|
+
computedProperty: v(0, 15),
|
|
6452
6515
|
templateLiteral: v(0, 13),
|
|
6453
6516
|
optionalChaining: v(0, 44),
|
|
6454
6517
|
methodShorthand: v(0, 15),
|
|
@@ -6472,6 +6535,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
6472
6535
|
return 5 < v && v < 1000 && (v += 2009), {
|
|
6473
6536
|
esVersion: v > 2022 ? 2022 : v,
|
|
6474
6537
|
const: v >= 2015,
|
|
6538
|
+
computedProperty: v >= 2015,
|
|
6475
6539
|
templateLiteral: v >= 2015,
|
|
6476
6540
|
optionalChaining: v >= 2020,
|
|
6477
6541
|
methodShorthand: v >= 2015,
|
|
@@ -6544,18 +6608,20 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
6544
6608
|
development
|
|
6545
6609
|
}), applySnapshotDefaults(options.snapshot, {
|
|
6546
6610
|
production
|
|
6611
|
+
}), applyOutputDefaults(options, {
|
|
6612
|
+
context: options.context,
|
|
6613
|
+
targetProperties,
|
|
6614
|
+
isAffectedByBrowserslist: void 0 === target || 'string' == typeof target && target.startsWith('browserslist') || Array.isArray(target) && target.some((target)=>target.startsWith('browserslist')),
|
|
6615
|
+
entry: options.entry
|
|
6547
6616
|
}), applyModuleDefaults(options.module, {
|
|
6548
6617
|
asyncWebAssembly: options.experiments.asyncWebAssembly,
|
|
6549
6618
|
targetProperties,
|
|
6550
6619
|
mode: options.mode,
|
|
6551
6620
|
uniqueName: options.output.uniqueName,
|
|
6552
6621
|
deferImport: options.experiments.deferImport,
|
|
6553
|
-
outputModule: options.output.module
|
|
6554
|
-
|
|
6555
|
-
|
|
6556
|
-
targetProperties,
|
|
6557
|
-
isAffectedByBrowserslist: void 0 === target || 'string' == typeof target && target.startsWith('browserslist') || Array.isArray(target) && target.some((target)=>target.startsWith('browserslist')),
|
|
6558
|
-
entry: options.entry
|
|
6622
|
+
outputModule: options.output.module,
|
|
6623
|
+
hashFunction: options.output.hashFunction,
|
|
6624
|
+
hashSalt: options.output.hashSalt
|
|
6559
6625
|
}), applyExternalsPresetsDefaults(options.externalsPresets, {
|
|
6560
6626
|
targetProperties,
|
|
6561
6627
|
buildHttp: !!options.experiments.buildHttp,
|
|
@@ -6587,9 +6653,11 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
6587
6653
|
D(experiments, 'futureDefaults', !1), D(experiments, 'asyncWebAssembly', !0), D(experiments, 'deferImport', !1), D(experiments, 'buildHttp', void 0), experiments.buildHttp && 'object' == typeof experiments.buildHttp && D(experiments.buildHttp, 'upgrade', !1), D(experiments, 'useInputFileSystem', !1), D(experiments, 'pureFunctions', !1);
|
|
6588
6654
|
}, applyIncrementalDefaults = (options)=>{
|
|
6589
6655
|
D(options, 'incremental', {}), 'object' == typeof options.incremental && (D(options.incremental, 'silent', !0), D(options.incremental, 'buildModuleGraph', !0), D(options.incremental, 'finishModules', !0), D(options.incremental, 'optimizeDependencies', !0), D(options.incremental, 'buildChunkGraph', !0), D(options.incremental, 'optimizeChunkModules', !0), D(options.incremental, 'moduleIds', !0), D(options.incremental, 'chunkIds', !0), D(options.incremental, 'modulesHashes', !0), D(options.incremental, 'modulesCodegen', !0), D(options.incremental, 'modulesRuntimeRequirements', !0), D(options.incremental, 'chunksRuntimeRequirements', !0), D(options.incremental, 'chunksHashes', !0), D(options.incremental, 'chunkAsset', !0), D(options.incremental, 'emitAssets', !0));
|
|
6590
|
-
}, applySnapshotDefaults = (_snapshot, _env)=>{},
|
|
6591
|
-
D(generatorOptions, 'exportsOnly', !targetProperties || !1 === targetProperties.document), D(generatorOptions, 'esModule', !0);
|
|
6592
|
-
},
|
|
6656
|
+
}, applySnapshotDefaults = (_snapshot, _env)=>{}, applyCssModuleGeneratorOptionsDefaults = (generatorOptions, { hashFunction, hashSalt, localIdentName, targetProperties })=>{
|
|
6657
|
+
D(generatorOptions, 'exportsOnly', !targetProperties || !1 === targetProperties.document), D(generatorOptions, 'esModule', !0), D(generatorOptions, 'exportsConvention', 'as-is'), D(generatorOptions, 'localIdentName', localIdentName), D(generatorOptions, 'localIdentHashSalt', hashSalt), D(generatorOptions, 'localIdentHashFunction', hashFunction), D(generatorOptions, 'localIdentHashDigest', 'base64url'), D(generatorOptions, 'localIdentHashDigestLength', 6);
|
|
6658
|
+
}, applyCssModuleParserOptionsDefaults = (parserOptions)=>{
|
|
6659
|
+
D(parserOptions, 'namedExports', !0), D(parserOptions, 'url', !0), D(parserOptions, 'import', !0);
|
|
6660
|
+
}, applyModuleDefaults = (module, { asyncWebAssembly, targetProperties, mode, uniqueName, deferImport, outputModule, hashFunction, hashSalt })=>{
|
|
6593
6661
|
assertNotNill(module.parser), assertNotNill(module.generator), F(module.parser, "asset", ()=>({})), assertNotNill(module.parser.asset), F(module.parser.asset, 'dataUrlCondition', ()=>({})), 'object' == typeof module.parser.asset.dataUrlCondition && D(module.parser.asset.dataUrlCondition, 'maxSize', 8096), F(module.parser, "javascript", ()=>({})), assertNotNill(module.parser.javascript), ((parserOptions, { deferImport, outputModule })=>{
|
|
6594
6662
|
D(parserOptions, 'dynamicImportMode', 'lazy'), D(parserOptions, 'dynamicImportPrefetch', !1), D(parserOptions, 'dynamicImportPreload', !1), D(parserOptions, 'url', !0), D(parserOptions, 'exprContextCritical', !0), D(parserOptions, 'unknownContextCritical', !0), D(parserOptions, 'wrappedContextCritical', !1), D(parserOptions, 'strictThisContextOnImports', !1), D(parserOptions, 'wrappedContextRegExp', /.*/), D(parserOptions, 'exportsPresence', 'error'), D(parserOptions, 'requireAsExpression', !0), D(parserOptions, 'requireAlias', !1), D(parserOptions, 'requireDynamic', !0), D(parserOptions, 'requireResolve', !0), D(parserOptions, 'commonjs', !0), D(parserOptions, 'importDynamic', !0), D(parserOptions, 'worker', [
|
|
6595
6663
|
'...'
|
|
@@ -6597,15 +6665,28 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
6597
6665
|
})(module.parser.javascript, {
|
|
6598
6666
|
deferImport,
|
|
6599
6667
|
outputModule
|
|
6600
|
-
}), F(module.parser, "json", ()=>({})), assertNotNill(module.parser.json), D(module.parser.json, 'exportsDepth', 'development' === mode ? 1 : Number.MAX_SAFE_INTEGER), F(module.generator, 'json', ()=>({})), assertNotNill(module.generator.json), D(module.generator.json, 'JSONParse', !0), F(module.parser, 'css', ()=>({})), assertNotNill(module.parser.css), D(module.parser.css, 'namedExports', !0), D(module.parser.css, 'url', !0), F(module.parser, 'css/auto', ()=>({})), assertNotNill(module.parser['css/auto']),
|
|
6601
|
-
targetProperties
|
|
6602
|
-
})
|
|
6668
|
+
}), F(module.parser, "json", ()=>({})), assertNotNill(module.parser.json), D(module.parser.json, 'exportsDepth', 'development' === mode ? 1 : Number.MAX_SAFE_INTEGER), F(module.generator, 'json', ()=>({})), assertNotNill(module.generator.json), D(module.generator.json, 'JSONParse', !0), F(module.parser, 'css', ()=>({})), assertNotNill(module.parser.css), D(module.parser.css, 'namedExports', !0), D(module.parser.css, 'url', !0), D(module.parser.css, 'import', !0), D(module.parser.css, 'animation', !0), F(module.parser, 'css/auto', ()=>({})), assertNotNill(module.parser['css/auto']), applyCssModuleParserOptionsDefaults(module.parser['css/auto']), F(module.parser, 'css/global', ()=>({})), assertNotNill(module.parser['css/global']), applyCssModuleParserOptionsDefaults(module.parser['css/global']), F(module.parser, 'css/module', ()=>({})), assertNotNill(module.parser['css/module']), applyCssModuleParserOptionsDefaults(module.parser['css/module']), F(module.generator, 'css', ()=>({})), assertNotNill(module.generator.css), ((generatorOptions, { targetProperties })=>{
|
|
6669
|
+
D(generatorOptions, 'exportsOnly', !targetProperties || !1 === targetProperties.document), D(generatorOptions, 'esModule', !0);
|
|
6670
|
+
})(module.generator.css, {
|
|
6603
6671
|
targetProperties
|
|
6604
|
-
}),
|
|
6672
|
+
}), F(module.generator, 'css/auto', ()=>({})), assertNotNill(module.generator['css/auto']);
|
|
6605
6673
|
let localIdentName = 'development' === mode ? uniqueName && uniqueName.length > 0 ? '[uniqueName]-[id]-[local]' : '[id]-[local]' : '[fullhash]';
|
|
6606
|
-
|
|
6674
|
+
applyCssModuleGeneratorOptionsDefaults(module.generator['css/auto'], {
|
|
6675
|
+
hashFunction,
|
|
6676
|
+
hashSalt,
|
|
6677
|
+
localIdentName,
|
|
6678
|
+
targetProperties
|
|
6679
|
+
}), F(module.generator, 'css/module', ()=>({})), assertNotNill(module.generator['css/module']), applyCssModuleGeneratorOptionsDefaults(module.generator['css/module'], {
|
|
6680
|
+
hashFunction,
|
|
6681
|
+
hashSalt,
|
|
6682
|
+
localIdentName,
|
|
6683
|
+
targetProperties
|
|
6684
|
+
}), F(module.generator, 'css/global', ()=>({})), assertNotNill(module.generator['css/global']), applyCssModuleGeneratorOptionsDefaults(module.generator['css/global'], {
|
|
6685
|
+
hashFunction,
|
|
6686
|
+
hashSalt,
|
|
6687
|
+
localIdentName,
|
|
6607
6688
|
targetProperties
|
|
6608
|
-
}),
|
|
6689
|
+
}), A(module, 'defaultRules', ()=>{
|
|
6609
6690
|
let esm = {
|
|
6610
6691
|
type: "javascript/esm",
|
|
6611
6692
|
resolve: {
|
|
@@ -6754,6 +6835,9 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
6754
6835
|
}), F(environment, 'const', ()=>{
|
|
6755
6836
|
let v;
|
|
6756
6837
|
return tp && ((v = tp.const) || void 0 === v);
|
|
6838
|
+
}), F(environment, 'computedProperty', ()=>{
|
|
6839
|
+
let v;
|
|
6840
|
+
return tp && ((v = tp.computedProperty) || void 0 === v);
|
|
6757
6841
|
}), F(environment, 'methodShorthand', ()=>{
|
|
6758
6842
|
let v;
|
|
6759
6843
|
return tp && ((v = tp.methodShorthand) || void 0 === v);
|
|
@@ -6872,7 +6956,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
6872
6956
|
return output.wasmLoading && enabledWasmLoadingTypes.add(output.wasmLoading), output.workerWasmLoading && enabledWasmLoadingTypes.add(output.workerWasmLoading), forEachEntry((desc)=>{
|
|
6873
6957
|
desc.wasmLoading && enabledWasmLoadingTypes.add(desc.wasmLoading);
|
|
6874
6958
|
}), Array.from(enabledWasmLoadingTypes);
|
|
6875
|
-
}), D(output, 'bundlerInfo', {}), 'object' == typeof output.bundlerInfo && (D(output.bundlerInfo, 'version', "2.0.
|
|
6959
|
+
}), D(output, 'bundlerInfo', {}), 'object' == typeof output.bundlerInfo && (D(output.bundlerInfo, 'version', "2.0.5"), D(output.bundlerInfo, 'bundler', 'rspack'), D(output.bundlerInfo, 'force', !1));
|
|
6876
6960
|
}, applyExternalsPresetsDefaults = (externalsPresets, { targetProperties, buildHttp, outputModule })=>{
|
|
6877
6961
|
let isUniversal = (key)=>!!(outputModule && targetProperties && null === targetProperties[key]);
|
|
6878
6962
|
D(externalsPresets, 'web', !buildHttp && targetProperties && (targetProperties.web || isUniversal('node'))), D(externalsPresets, 'node', targetProperties && (targetProperties.node || isUniversal('node'))), D(externalsPresets, 'electron', targetProperties && targetProperties.electron || isUniversal('electron')), D(externalsPresets, 'electronMain', targetProperties && !!targetProperties.electron && (targetProperties.electronMain || isUniversal('electronMain'))), D(externalsPresets, 'electronPreload', targetProperties && !!targetProperties.electron && (targetProperties.electronPreload || isUniversal('electronPreload'))), D(externalsPresets, 'electronRenderer', targetProperties && !!targetProperties.electron && (targetProperties.electronRenderer || isUniversal('electronRenderer'))), D(externalsPresets, 'nwjs', targetProperties && (targetProperties.nwjs || isUniversal('nwjs')));
|
|
@@ -7894,7 +7978,7 @@ class ItemCacheFacade {
|
|
|
7894
7978
|
return await this.storePromise(result), result;
|
|
7895
7979
|
}
|
|
7896
7980
|
}
|
|
7897
|
-
class CacheFacade {
|
|
7981
|
+
let lib_CacheFacade = class CacheFacade {
|
|
7898
7982
|
_name;
|
|
7899
7983
|
_cache;
|
|
7900
7984
|
_hashFunction;
|
|
@@ -7987,7 +8071,7 @@ class CacheFacade {
|
|
|
7987
8071
|
let result = await computer();
|
|
7988
8072
|
return await this.storePromise(identifier, etag, result), result;
|
|
7989
8073
|
}
|
|
7990
|
-
}
|
|
8074
|
+
};
|
|
7991
8075
|
class NormalModuleFactory {
|
|
7992
8076
|
hooks;
|
|
7993
8077
|
resolverFactory;
|
|
@@ -8126,7 +8210,7 @@ class MultiStats {
|
|
|
8126
8210
|
obj.children = this.stats.map((stat, idx)=>{
|
|
8127
8211
|
let obj = stat.toJson(childOptions.children[idx]), compilationName = stat.compilation.name;
|
|
8128
8212
|
return obj.name = compilationName && makePathsRelative(childOptions.context, compilationName, stat.compilation.compiler.root), obj;
|
|
8129
|
-
}), childOptions.version && (obj.rspackVersion = "2.0.
|
|
8213
|
+
}), childOptions.version && (obj.rspackVersion = "2.0.5", obj.version = "5.75.0"), childOptions.hash && (obj.hash = obj.children.map((j)=>j.hash).join(''));
|
|
8130
8214
|
let mapError = (j, obj)=>({
|
|
8131
8215
|
...obj,
|
|
8132
8216
|
compilerPath: obj.compilerPath ? `${j.name}.${obj.compilerPath}` : j.name
|
|
@@ -8635,7 +8719,7 @@ let arraySum = (array)=>{
|
|
|
8635
8719
|
let str = `${a}`, length = lengths[i];
|
|
8636
8720
|
return str.length === length ? str : length > 5 ? `...${str.slice(-length + 3)}` : length > 0 ? str.slice(-length) : '';
|
|
8637
8721
|
});
|
|
8638
|
-
}, CachedInputFileSystem = __webpack_require__("../../node_modules/.pnpm/enhanced-resolve@5.21.
|
|
8722
|
+
}, CachedInputFileSystem = __webpack_require__("../../node_modules/.pnpm/enhanced-resolve@5.21.3/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js");
|
|
8639
8723
|
var CachedInputFileSystem_default = __webpack_require__.n(CachedInputFileSystem);
|
|
8640
8724
|
class NodeEnvironmentPlugin {
|
|
8641
8725
|
options;
|
|
@@ -9400,7 +9484,7 @@ let iterateConfig = (config, options, fn)=>{
|
|
|
9400
9484
|
object.hash = context.getStatsCompilation(compilation).hash;
|
|
9401
9485
|
},
|
|
9402
9486
|
version: (object)=>{
|
|
9403
|
-
object.version = "5.75.0", object.rspackVersion = "2.0.
|
|
9487
|
+
object.version = "5.75.0", object.rspackVersion = "2.0.5";
|
|
9404
9488
|
},
|
|
9405
9489
|
env: (object, _compilation, _context, { _env })=>{
|
|
9406
9490
|
object.env = _env;
|
|
@@ -10626,10 +10710,11 @@ class RspackOptionsApply {
|
|
|
10626
10710
|
process(options, compiler) {
|
|
10627
10711
|
if (!options.output.path) throw Error('options.output.path should have a value after `applyRspackOptionsDefaults`');
|
|
10628
10712
|
if (compiler.outputPath = options.output.path, compiler.name = options.name, compiler.outputFileSystem = node_fs, options.externals) {
|
|
10713
|
+
let presets;
|
|
10629
10714
|
if (!options.externalsType) throw Error('options.externalsType should have a value after `applyRspackOptionsDefaults`');
|
|
10630
|
-
new ExternalsPlugin(options.externalsType, options.externals, !1).apply(compiler);
|
|
10715
|
+
new ExternalsPlugin(options.externalsType, options.externals, !1, (presets = options.externalsPresets).node || presets.electron || presets.electronMain || presets.electronPreload || presets.electronRenderer || presets.nwjs ? 'node-commonjs' : 'commonjs').apply(compiler);
|
|
10631
10716
|
}
|
|
10632
|
-
if (options.externalsPresets.node && new NodeTargetPlugin().apply(compiler), options.externalsPresets.electronMain && new ElectronTargetPlugin('main').apply(compiler), options.externalsPresets.electronPreload && new ElectronTargetPlugin('preload').apply(compiler), options.externalsPresets.electronRenderer && new ElectronTargetPlugin('renderer').apply(compiler), !options.externalsPresets.electron || options.externalsPresets.electronMain || options.externalsPresets.electronPreload || options.externalsPresets.electronRenderer || new ElectronTargetPlugin().apply(compiler), options.externalsPresets.nwjs && new ExternalsPlugin('node-commonjs', 'nw.gui', !1).apply(compiler), (options.externalsPresets.web || options.externalsPresets.webAsync
|
|
10717
|
+
if (options.externalsPresets.node && (new NodeTargetPlugin().apply(compiler), new CssHttpExternalsRspackPlugin().apply(compiler)), options.externalsPresets.electronMain && new ElectronTargetPlugin('main').apply(compiler), options.externalsPresets.electronPreload && new ElectronTargetPlugin('preload').apply(compiler), options.externalsPresets.electronRenderer && new ElectronTargetPlugin('renderer').apply(compiler), !options.externalsPresets.electron || options.externalsPresets.electronMain || options.externalsPresets.electronPreload || options.externalsPresets.electronRenderer || new ElectronTargetPlugin().apply(compiler), options.externalsPresets.nwjs && new ExternalsPlugin('node-commonjs', 'nw.gui', !1).apply(compiler), (options.externalsPresets.web || options.externalsPresets.webAsync) && new HttpExternalsRspackPlugin(!!options.externalsPresets.webAsync).apply(compiler), new ChunkPrefetchPreloadPlugin().apply(compiler), options.output.pathinfo && new ModuleInfoHeaderPlugin('verbose' === options.output.pathinfo).apply(compiler), 'string' == typeof options.output.chunkFormat) switch(options.output.chunkFormat){
|
|
10633
10718
|
case 'array-push':
|
|
10634
10719
|
new ArrayPushCallbackChunkFormatPlugin().apply(compiler);
|
|
10635
10720
|
break;
|
|
@@ -10662,7 +10747,7 @@ class RspackOptionsApply {
|
|
|
10662
10747
|
moduleFilenameTemplate: options.output.devtoolModuleFilenameTemplate,
|
|
10663
10748
|
namespace: options.output.devtoolNamespace
|
|
10664
10749
|
}).apply(compiler);
|
|
10665
|
-
new JavascriptModulesPlugin().apply(compiler), new URLPlugin().apply(compiler), new JsonModulesPlugin().apply(compiler), new AssetModulesPlugin().apply(compiler), options.experiments.asyncWebAssembly && new AsyncWebAssemblyModulesPlugin().apply(compiler), new CssModulesPlugin().apply(compiler), new lib_EntryOptionPlugin().apply(compiler), assertNotNill(options.context), compiler.hooks.entryOption.call(options.context, options.entry), new RuntimePlugin().apply(compiler), options.output.bundlerInfo && new BundlerInfoRspackPlugin(options.output.bundlerInfo).apply(compiler), new InferAsyncModulesPlugin().apply(compiler), new APIPlugin().apply(compiler), new DataUriPlugin().apply(compiler), new FileUriPlugin().apply(compiler), options.experiments.buildHttp && new HttpUriPlugin(options.experiments.buildHttp).apply(compiler), new EnsureChunkConditionsPlugin().apply(compiler), options.optimization.mergeDuplicateChunks && new MergeDuplicateChunksPlugin().apply(compiler), options.optimization.sideEffects && new SideEffectsFlagPlugin(options.experiments.pureFunctions).apply(compiler), options.optimization.providedExports && new FlagDependencyExportsPlugin().apply(compiler), options.optimization.usedExports && new FlagDependencyUsagePlugin('global' === options.optimization.usedExports).apply(compiler), options.optimization.concatenateModules && new ModuleConcatenationPlugin().apply(compiler), options.optimization.inlineExports && new InlineExportsPlugin().apply(compiler), options.optimization.mangleExports && new MangleExportsPlugin('size' !== options.optimization.mangleExports).apply(compiler);
|
|
10750
|
+
new JavascriptModulesPlugin().apply(compiler), new URLPlugin().apply(compiler), new JsonModulesPlugin().apply(compiler), new AssetModulesPlugin().apply(compiler), options.experiments.asyncWebAssembly && new AsyncWebAssemblyModulesPlugin().apply(compiler), new CssModulesPlugin().apply(compiler), new lib_EntryOptionPlugin().apply(compiler), assertNotNill(options.context), compiler.hooks.entryOption.call(options.context, options.entry), new RuntimePlugin().apply(compiler), options.output.bundlerInfo && new BundlerInfoRspackPlugin(options.output.bundlerInfo).apply(compiler), new InferAsyncModulesPlugin().apply(compiler), new APIPlugin().apply(compiler), new DataUriPlugin().apply(compiler), new FileUriPlugin().apply(compiler), options.experiments.buildHttp && new HttpUriPlugin(options.experiments.buildHttp).apply(compiler), new EnsureChunkConditionsPlugin().apply(compiler), options.optimization.mergeDuplicateChunks && new MergeDuplicateChunksPlugin().apply(compiler), options.optimization.sideEffects && new SideEffectsFlagPlugin(options.experiments.pureFunctions).apply(compiler), options.optimization.providedExports && new FlagDependencyExportsPlugin().apply(compiler), 'production' === options.mode && new CircularModulesInfoPlugin().apply(compiler), options.optimization.usedExports && new FlagDependencyUsagePlugin('global' === options.optimization.usedExports).apply(compiler), options.optimization.concatenateModules && new ModuleConcatenationPlugin().apply(compiler), options.optimization.inlineExports && new InlineExportsPlugin().apply(compiler), options.optimization.mangleExports && new MangleExportsPlugin('size' !== options.optimization.mangleExports).apply(compiler);
|
|
10666
10751
|
let enableLibSplitChunks = !1;
|
|
10667
10752
|
if (options.output.enabledLibraryTypes && options.output.enabledLibraryTypes.length > 0) {
|
|
10668
10753
|
let hasModernModule = options.output.enabledLibraryTypes.includes('modern-module'), hasNonModernModule = options.output.enabledLibraryTypes.some((t)=>'modern-module' !== t);
|
|
@@ -11058,7 +11143,7 @@ class TraceHookPlugin {
|
|
|
11058
11143
|
});
|
|
11059
11144
|
}
|
|
11060
11145
|
}
|
|
11061
|
-
let CORE_VERSION = "2.0.
|
|
11146
|
+
let CORE_VERSION = "2.0.5", VFILES_BY_COMPILER = new WeakMap();
|
|
11062
11147
|
class VirtualModulesPlugin {
|
|
11063
11148
|
#staticModules;
|
|
11064
11149
|
#compiler;
|
|
@@ -11436,7 +11521,7 @@ class Compiler {
|
|
|
11436
11521
|
return this.#ruleSet;
|
|
11437
11522
|
}
|
|
11438
11523
|
getCache(name) {
|
|
11439
|
-
return new
|
|
11524
|
+
return new lib_CacheFacade(this.cache, `${this.compilerPath}${name}`, this.options.output.hashFunction);
|
|
11440
11525
|
}
|
|
11441
11526
|
getInfrastructureLogger(name) {
|
|
11442
11527
|
if (!name) throw TypeError('Compiler.getInfrastructureLogger(name) called without a name');
|
|
@@ -11623,6 +11708,7 @@ Help:
|
|
|
11623
11708
|
environment: function(environment = {}) {
|
|
11624
11709
|
return {
|
|
11625
11710
|
const: !!environment.const,
|
|
11711
|
+
computedProperty: !!environment.computedProperty,
|
|
11626
11712
|
methodShorthand: !!environment.methodShorthand,
|
|
11627
11713
|
arrowFunction: !!environment.arrowFunction,
|
|
11628
11714
|
nodePrefixForCoreModules: !!environment.nodePrefixForCoreModules,
|
|
@@ -13361,7 +13447,7 @@ async function transform(source, options) {
|
|
|
13361
13447
|
let _options = JSON.stringify(options || {});
|
|
13362
13448
|
return binding_default().transform(source, _options);
|
|
13363
13449
|
}
|
|
13364
|
-
let exports_rspackVersion = "2.0.
|
|
13450
|
+
let exports_rspackVersion = "2.0.5", exports_version = "5.75.0", exports_WebpackError = Error, exports_config = {
|
|
13365
13451
|
getNormalizedRspackOptions: getNormalizedRspackOptions,
|
|
13366
13452
|
applyRspackOptionsDefaults: applyRspackOptionsDefaults,
|
|
13367
13453
|
getNormalizedWebpackOptions: getNormalizedRspackOptions,
|
package/module.d.ts
CHANGED
|
@@ -171,6 +171,16 @@ declare namespace Rspack {
|
|
|
171
171
|
(dependency: string): unknown;
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
+
type ImportMetaGlobPattern = string | readonly string[];
|
|
175
|
+
type ImportMetaGlobQuery = string | Record<string, string | number | boolean>;
|
|
176
|
+
type ImportMetaGlobOptions<Eager extends boolean = boolean> = {
|
|
177
|
+
eager?: Eager;
|
|
178
|
+
import?: string;
|
|
179
|
+
query?: ImportMetaGlobQuery;
|
|
180
|
+
exhaustive?: boolean;
|
|
181
|
+
base?: string;
|
|
182
|
+
};
|
|
183
|
+
|
|
174
184
|
interface Module {
|
|
175
185
|
exports: any;
|
|
176
186
|
id: ModuleId;
|
|
@@ -241,6 +251,16 @@ interface ImportMeta {
|
|
|
241
251
|
rspackRsc?: {
|
|
242
252
|
loadCss(): any;
|
|
243
253
|
};
|
|
254
|
+
glob: {
|
|
255
|
+
<T = unknown>(
|
|
256
|
+
pattern: Rspack.ImportMetaGlobPattern,
|
|
257
|
+
options?: Rspack.ImportMetaGlobOptions<false>,
|
|
258
|
+
): Record<string, () => Promise<T>>;
|
|
259
|
+
<T = unknown>(
|
|
260
|
+
pattern: Rspack.ImportMetaGlobPattern,
|
|
261
|
+
options: Rspack.ImportMetaGlobOptions<true>,
|
|
262
|
+
): Record<string, T>;
|
|
263
|
+
};
|
|
244
264
|
}
|
|
245
265
|
|
|
246
266
|
declare const __resourceQuery: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspack/core",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.5",
|
|
4
4
|
"webpackVersion": "5.75.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Fast Rust-based bundler for the web with a modernized webpack API",
|
|
@@ -37,17 +37,17 @@
|
|
|
37
37
|
"directory": "packages/rspack"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@ast-grep/napi": "^0.42.
|
|
40
|
+
"@ast-grep/napi": "^0.42.3",
|
|
41
41
|
"@napi-rs/wasm-runtime": "1.1.4",
|
|
42
42
|
"@rsbuild/plugin-node-polyfill": "^1.4.4",
|
|
43
|
-
"@rslib/core": "^0.21.
|
|
43
|
+
"@rslib/core": "^0.21.5",
|
|
44
44
|
"@rspack/lite-tapable": "1.1.0",
|
|
45
45
|
"@swc/types": "0.1.26",
|
|
46
|
-
"@types/node": "^20.19.
|
|
46
|
+
"@types/node": "^20.19.41",
|
|
47
47
|
"browserslist-load-config": "^1.0.1",
|
|
48
48
|
"browserslist-to-es-version": "^1.4.1",
|
|
49
49
|
"connect-next": "^4.0.1",
|
|
50
|
-
"enhanced-resolve": "5.21.
|
|
50
|
+
"enhanced-resolve": "5.21.3",
|
|
51
51
|
"http-proxy-middleware": "^4.0.0",
|
|
52
52
|
"memfs": "4.57.2",
|
|
53
53
|
"open": "^11.0.0",
|
|
@@ -58,11 +58,11 @@
|
|
|
58
58
|
"webpack-sources": "3.3.4"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@rspack/binding": "2.0.
|
|
61
|
+
"@rspack/binding": "2.0.5"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
64
|
"@module-federation/runtime-tools": "^0.24.1 || ^2.0.0",
|
|
65
|
-
"@swc/helpers": "
|
|
65
|
+
"@swc/helpers": "^0.5.23"
|
|
66
66
|
},
|
|
67
67
|
"peerDependenciesMeta": {
|
|
68
68
|
"@module-federation/runtime-tools": {
|