@rspack/core 2.0.4 → 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.
@@ -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
  }
@@ -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 */
@@ -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. */
@@ -752,11 +754,31 @@ export type CssParserOptions = {
752
754
  * @default true
753
755
  * */
754
756
  url?: CssParserUrl;
757
+ /**
758
+ * Allow to enable/disables `@import` at-rules handling.
759
+ * @default true
760
+ * */
761
+ import?: boolean;
755
762
  /**
756
763
  * Allow to enable/disables `@import` at-rules handling.
757
764
  * @default true
758
765
  * */
759
766
  resolveImport?: CssParserResolveImport;
767
+ /**
768
+ * Enable/disable renaming of `@keyframes`.
769
+ * @default true
770
+ */
771
+ animation?: boolean;
772
+ /**
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;
760
782
  };
761
783
  /** Options object for `css/auto`, `css/global` and `css/module` modules. */
762
784
  export type CssModuleParserOptions = {
@@ -774,7 +796,27 @@ export type CssModuleParserOptions = {
774
796
  * Allow to enable/disables `@import` at-rules handling.
775
797
  * @default true
776
798
  * */
799
+ import?: boolean;
800
+ /**
801
+ * Allow to filter handling of `@import` at-rules.
802
+ * @default true
803
+ * */
777
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;
778
820
  };
779
821
  type ExportsPresence = 'error' | 'warn' | 'auto' | false;
780
822
  export type JavascriptParserCommonjsExports = boolean | 'skipInEsm';
package/dist/index.js CHANGED
@@ -2439,21 +2439,21 @@ let HOOKS_CAN_NOT_INHERENT_FROM_PARENT = [
2439
2439
  function canInherentFromParent(affectedHooks) {
2440
2440
  return void 0 !== affectedHooks && !HOOKS_CAN_NOT_INHERENT_FROM_PARENT.includes(affectedHooks);
2441
2441
  }
2442
- class base_RspackBuiltinPlugin {
2442
+ class RspackBuiltinPlugin {
2443
2443
  affectedHooks;
2444
2444
  apply(compiler) {
2445
2445
  let raw = this.raw(compiler);
2446
2446
  raw && (raw.canInherentFromParent = canInherentFromParent(this.affectedHooks), compiler.__internal__registerBuiltinPlugin(raw));
2447
2447
  }
2448
2448
  }
2449
- function base_createBuiltinPlugin(name, options) {
2449
+ function createBuiltinPlugin(name, options) {
2450
2450
  return {
2451
2451
  name: name,
2452
2452
  options: options ?? !1
2453
2453
  };
2454
2454
  }
2455
2455
  function base_create(name, resolve, affectedHooks) {
2456
- class Plugin extends base_RspackBuiltinPlugin {
2456
+ class Plugin extends RspackBuiltinPlugin {
2457
2457
  name = name;
2458
2458
  _args;
2459
2459
  affectedHooks = affectedHooks;
@@ -2461,7 +2461,7 @@ function base_create(name, resolve, affectedHooks) {
2461
2461
  super(), this._args = args;
2462
2462
  }
2463
2463
  raw(compiler) {
2464
- return base_createBuiltinPlugin(name, resolve.apply(compiler, this._args));
2464
+ return createBuiltinPlugin(name, resolve.apply(compiler, this._args));
2465
2465
  }
2466
2466
  }
2467
2467
  return Object.defineProperty(Plugin, 'name', {
@@ -2484,7 +2484,13 @@ 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 CircularDependencyRspackPlugin extends base_RspackBuiltinPlugin {
2487
+ class CircularModulesInfoPlugin extends RspackBuiltinPlugin {
2488
+ name = binding_namespaceObject.BuiltinPluginName.CircularModulesInfoPlugin;
2489
+ raw(_compiler) {
2490
+ return createBuiltinPlugin(this.name, void 0);
2491
+ }
2492
+ }
2493
+ class CircularDependencyRspackPlugin extends RspackBuiltinPlugin {
2488
2494
  name = binding_namespaceObject.BuiltinPluginName.CircularDependencyRspackPlugin;
2489
2495
  _options;
2490
2496
  constructor(options){
@@ -2512,7 +2518,7 @@ class CircularDependencyRspackPlugin extends base_RspackBuiltinPlugin {
2512
2518
  this._options.onEnd(compilation);
2513
2519
  } : void 0
2514
2520
  };
2515
- return base_createBuiltinPlugin(this.name, rawOptions);
2521
+ return createBuiltinPlugin(this.name, rawOptions);
2516
2522
  }
2517
2523
  }
2518
2524
  let CommonJsChunkFormatPlugin = base_create(binding_namespaceObject.BuiltinPluginName.CommonJsChunkFormatPlugin, ()=>{}), ContextReplacementPlugin = base_create(binding_namespaceObject.BuiltinPluginName.ContextReplacementPlugin, (resourceRegExp, newContentResource, newContentRecursive, newContentRegExp)=>{
@@ -2595,18 +2601,18 @@ let DataUriPlugin = base_create(binding_namespaceObject.BuiltinPluginName.DataUr
2595
2601
  ])) : normalizePrimitive(define);
2596
2602
  return normalizeObject(define);
2597
2603
  };
2598
- class DeterministicChunkIdsPlugin extends base_RspackBuiltinPlugin {
2604
+ class DeterministicChunkIdsPlugin extends RspackBuiltinPlugin {
2599
2605
  name = binding_namespaceObject.BuiltinPluginName.DeterministicChunkIdsPlugin;
2600
2606
  affectedHooks = 'compilation';
2601
2607
  raw() {
2602
- return base_createBuiltinPlugin(this.name, void 0);
2608
+ return createBuiltinPlugin(this.name, void 0);
2603
2609
  }
2604
2610
  }
2605
- class DeterministicModuleIdsPlugin extends base_RspackBuiltinPlugin {
2611
+ class DeterministicModuleIdsPlugin extends RspackBuiltinPlugin {
2606
2612
  name = binding_namespaceObject.BuiltinPluginName.DeterministicModuleIdsPlugin;
2607
2613
  affectedHooks = 'compilation';
2608
2614
  raw() {
2609
- return base_createBuiltinPlugin(this.name, void 0);
2615
+ return createBuiltinPlugin(this.name, void 0);
2610
2616
  }
2611
2617
  }
2612
2618
  let DllEntryPlugin = base_create(binding_namespaceObject.BuiltinPluginName.DllEntryPlugin, (context, entries, options)=>({
@@ -2662,7 +2668,7 @@ function getRawEntryOptions(entry) {
2662
2668
  };
2663
2669
  }
2664
2670
  EntryPlugin.createDependency = (request)=>new binding_namespaceObject.EntryDependency(request);
2665
- class DynamicEntryPlugin extends base_RspackBuiltinPlugin {
2671
+ class DynamicEntryPlugin extends RspackBuiltinPlugin {
2666
2672
  context;
2667
2673
  entry;
2668
2674
  name = binding_namespaceObject.BuiltinPluginName.DynamicEntryPlugin;
@@ -2681,7 +2687,7 @@ class DynamicEntryPlugin extends base_RspackBuiltinPlugin {
2681
2687
  };
2682
2688
  })
2683
2689
  };
2684
- return base_createBuiltinPlugin(this.name, raw);
2690
+ return createBuiltinPlugin(this.name, raw);
2685
2691
  }
2686
2692
  }
2687
2693
  let ElectronTargetPlugin = base_create(binding_namespaceObject.BuiltinPluginName.ElectronTargetPlugin, (context)=>context ?? 'none'), EnableChunkLoadingPluginInner = base_create(binding_namespaceObject.BuiltinPluginName.EnableChunkLoadingPlugin, (type)=>type), enabledTypes = new WeakMap(), getEnabledTypes = (compiler)=>{
@@ -2717,7 +2723,7 @@ class JsSplitChunkSizes {
2717
2723
  } : sizes;
2718
2724
  }
2719
2725
  }
2720
- class SplitChunksPlugin extends base_RspackBuiltinPlugin {
2726
+ class SplitChunksPlugin extends RspackBuiltinPlugin {
2721
2727
  options;
2722
2728
  name = binding_namespaceObject.BuiltinPluginName.SplitChunksPlugin;
2723
2729
  affectedHooks = 'thisCompilation';
@@ -2727,7 +2733,7 @@ class SplitChunksPlugin extends base_RspackBuiltinPlugin {
2727
2733
  raw(compiler) {
2728
2734
  let rawOptions = SplitChunksPlugin_toRawSplitChunksOptions(this.options, compiler);
2729
2735
  if (void 0 === rawOptions) throw Error('rawOptions should not be undefined');
2730
- return base_createBuiltinPlugin(this.name, rawOptions);
2736
+ return createBuiltinPlugin(this.name, rawOptions);
2731
2737
  }
2732
2738
  }
2733
2739
  function SplitChunksPlugin_toRawSplitChunksOptions(sc, compiler) {
@@ -2785,7 +2791,7 @@ let EnableLibraryPlugin_enabledTypes = new WeakMap(), EnableLibraryPlugin_getEna
2785
2791
  let set = EnableLibraryPlugin_enabledTypes.get(compiler);
2786
2792
  return void 0 === set && (set = new Set(), EnableLibraryPlugin_enabledTypes.set(compiler, set)), set;
2787
2793
  };
2788
- class EnableLibraryPlugin extends base_RspackBuiltinPlugin {
2794
+ class EnableLibraryPlugin extends RspackBuiltinPlugin {
2789
2795
  type;
2790
2796
  name = binding_namespaceObject.BuiltinPluginName.EnableLibraryPlugin;
2791
2797
  constructor(type){
@@ -2799,7 +2805,7 @@ class EnableLibraryPlugin extends base_RspackBuiltinPlugin {
2799
2805
  }
2800
2806
  raw(compiler) {
2801
2807
  let type = this.type, enabled = EnableLibraryPlugin_getEnabledTypes(compiler);
2802
- if (!enabled.has(type)) return enabled.add(type), base_createBuiltinPlugin(this.name, {
2808
+ if (!enabled.has(type)) return enabled.add(type), createBuiltinPlugin(this.name, {
2803
2809
  libraryType: type,
2804
2810
  preserveModules: compiler.options.output.library?.preserveModules,
2805
2811
  splitChunks: SplitChunksPlugin_toRawSplitChunksOptions(compiler.options.optimization.splitChunks ?? !1, compiler)
@@ -4403,7 +4409,7 @@ function getRawRuleSetCondition(condition) {
4403
4409
  throw Error('unreachable: condition should be one of string, RegExp, Array, Object');
4404
4410
  }
4405
4411
  function getRawParserOptions(parser, type) {
4406
- var parser1, parser2;
4412
+ var parser1, parser2, parser3;
4407
4413
  if ('asset' === type) {
4408
4414
  return {
4409
4415
  type: 'asset',
@@ -4436,10 +4442,20 @@ function getRawParserOptions(parser, type) {
4436
4442
  type: "javascript/esm",
4437
4443
  javascript: getRawJavascriptParserOptions(parser)
4438
4444
  };
4439
- if ('css' === type) return {
4440
- type: 'css',
4441
- css: getRawCssParserOptions(parser)
4442
- };
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
+ }
4443
4459
  if ('css/auto' === type) return {
4444
4460
  type: 'css/auto',
4445
4461
  cssAuto: getRawCssParserOptions(parser)
@@ -4456,8 +4472,8 @@ function getRawParserOptions(parser, type) {
4456
4472
  return {
4457
4473
  type: 'json',
4458
4474
  json: {
4459
- exportsDepth: (parser2 = parser).exportsDepth,
4460
- parse: 'function' == typeof parser2.parse ? (str)=>JSON.stringify(parser2.parse(str)) : void 0
4475
+ exportsDepth: (parser3 = parser).exportsDepth,
4476
+ parse: 'function' == typeof parser3.parse ? (str)=>JSON.stringify(parser3.parse(str)) : void 0
4461
4477
  }
4462
4478
  };
4463
4479
  }
@@ -4501,7 +4517,11 @@ function getRawCssParserOptions(parser) {
4501
4517
  return {
4502
4518
  namedExports: parser.namedExports,
4503
4519
  url: parser.url,
4504
- resolveImport: parser.resolveImport
4520
+ import: parser.import,
4521
+ resolveImport: parser.resolveImport,
4522
+ animation: parser.animation,
4523
+ customIdents: parser.customIdents,
4524
+ dashedIdents: parser.dashedIdents
4505
4525
  };
4506
4526
  }
4507
4527
  function getRawGeneratorOptions(generator, type) {
@@ -4594,24 +4614,26 @@ function getRawCssAutoOrModuleGeneratorOptions(options) {
4594
4614
  esModule: options.esModule
4595
4615
  };
4596
4616
  }
4597
- class ExternalsPlugin extends base_RspackBuiltinPlugin {
4617
+ class ExternalsPlugin extends RspackBuiltinPlugin {
4598
4618
  type;
4599
4619
  externals;
4600
4620
  placeInInitial;
4621
+ fallbackType;
4601
4622
  name = binding_namespaceObject.BuiltinPluginName.ExternalsPlugin;
4602
4623
  #resolveRequestCache = new Map();
4603
- constructor(type, externals, placeInInitial){
4604
- 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;
4605
4626
  }
4606
4627
  raw() {
4607
4628
  let type = this.type, externals = this.externals, raw = {
4608
4629
  type,
4630
+ fallbackType: this.fallbackType,
4609
4631
  externals: (Array.isArray(externals) ? externals : [
4610
4632
  externals
4611
4633
  ]).filter(Boolean).map((item)=>this.#getRawExternalItem(item)),
4612
4634
  placeInInitial: this.placeInInitial ?? !1
4613
4635
  };
4614
- return base_createBuiltinPlugin(this.name, raw);
4636
+ return createBuiltinPlugin(this.name, raw);
4615
4637
  }
4616
4638
  #processResolveResult = (text)=>{
4617
4639
  if (!text) return;
@@ -4689,7 +4711,7 @@ function getRawExternalItemValue(value) {
4689
4711
  ])) : value;
4690
4712
  }
4691
4713
  let FetchCompileAsyncWasmPlugin = base_create(binding_namespaceObject.BuiltinPluginName.FetchCompileAsyncWasmPlugin, ()=>{}, 'thisCompilation'), FileUriPlugin = base_create(binding_namespaceObject.BuiltinPluginName.FileUriPlugin, ()=>{}, 'compilation'), FlagDependencyExportsPlugin = base_create(binding_namespaceObject.BuiltinPluginName.FlagDependencyExportsPlugin, ()=>{}, 'compilation');
4692
- class FlagDependencyUsagePlugin extends base_RspackBuiltinPlugin {
4714
+ class FlagDependencyUsagePlugin extends RspackBuiltinPlugin {
4693
4715
  global;
4694
4716
  name = binding_namespaceObject.BuiltinPluginName.FlagDependencyUsagePlugin;
4695
4717
  affectedHooks = 'compilation';
@@ -4697,16 +4719,16 @@ class FlagDependencyUsagePlugin extends base_RspackBuiltinPlugin {
4697
4719
  super(), this.global = global;
4698
4720
  }
4699
4721
  raw() {
4700
- return base_createBuiltinPlugin(this.name, this.global);
4722
+ return createBuiltinPlugin(this.name, this.global);
4701
4723
  }
4702
4724
  }
4703
4725
  let HashedModuleIdsPlugin = base_create(binding_namespaceObject.BuiltinPluginName.HashedModuleIdsPlugin, (options)=>({
4704
4726
  ...options
4705
4727
  }), 'compilation');
4706
- class HotModuleReplacementPlugin extends base_RspackBuiltinPlugin {
4728
+ class HotModuleReplacementPlugin extends RspackBuiltinPlugin {
4707
4729
  name = binding_namespaceObject.BuiltinPluginName.HotModuleReplacementPlugin;
4708
4730
  raw(compiler) {
4709
- return void 0 === compiler.options.output.strictModuleErrorHandling && (compiler.options.output.strictModuleErrorHandling = !0), base_createBuiltinPlugin(this.name, void 0);
4731
+ return void 0 === compiler.options.output.strictModuleErrorHandling && (compiler.options.output.strictModuleErrorHandling = !0), createBuiltinPlugin(this.name, void 0);
4710
4732
  }
4711
4733
  }
4712
4734
  let HttpExternalsRspackPlugin = base_create(binding_namespaceObject.BuiltinPluginName.HttpExternalsRspackPlugin, (webAsync)=>({
@@ -4740,7 +4762,7 @@ let HttpExternalsRspackPlugin = base_create(binding_namespaceObject.BuiltinPlugi
4740
4762
  body: Buffer.from(body)
4741
4763
  };
4742
4764
  };
4743
- class HttpUriPlugin extends base_RspackBuiltinPlugin {
4765
+ class HttpUriPlugin extends RspackBuiltinPlugin {
4744
4766
  options;
4745
4767
  name = binding_namespaceObject.BuiltinPluginName.HttpUriPlugin;
4746
4768
  affectedHooks = 'compilation';
@@ -4755,7 +4777,7 @@ class HttpUriPlugin extends base_RspackBuiltinPlugin {
4755
4777
  upgrade: options.upgrade ?? !1,
4756
4778
  httpClient: options.httpClient ?? defaultHttpClientForNode
4757
4779
  };
4758
- return base_createBuiltinPlugin(this.name, raw);
4780
+ return createBuiltinPlugin(this.name, raw);
4759
4781
  }
4760
4782
  }
4761
4783
  let compilationOptionsMap = new WeakMap(), hooks_compilationHooksMap = new WeakMap(), plugin_require = createRequire(import.meta.url), HTML_PLUGIN_UID = 0, HtmlRspackPlugin = base_create(binding_namespaceObject.BuiltinPluginName.HtmlRspackPlugin, function(c = {}) {
@@ -4906,11 +4928,11 @@ HtmlRspackPlugin.createHtmlTagObject = (tagName, attributes, innerHTML)=>({
4906
4928
  }, hooks_compilationHooksMap.set(compilation, hooks)), hooks;
4907
4929
  }, HtmlRspackPlugin.version = 5;
4908
4930
  let IgnorePlugin = base_create(binding_namespaceObject.BuiltinPluginName.IgnorePlugin, (options)=>options), InferAsyncModulesPlugin = base_create(binding_namespaceObject.BuiltinPluginName.InferAsyncModulesPlugin, ()=>{}, 'compilation'), InlineExportsPlugin = base_create(binding_namespaceObject.BuiltinPluginName.InlineExportsPlugin, ()=>{}, 'compilation'), JavascriptModulesPlugin_compilationHooksMap = new WeakMap();
4909
- class JavascriptModulesPlugin extends base_RspackBuiltinPlugin {
4931
+ class JavascriptModulesPlugin extends RspackBuiltinPlugin {
4910
4932
  name = binding_namespaceObject.BuiltinPluginName.JavascriptModulesPlugin;
4911
4933
  affectedHooks = 'compilation';
4912
4934
  raw() {
4913
- return base_createBuiltinPlugin(this.name, void 0);
4935
+ return createBuiltinPlugin(this.name, void 0);
4914
4936
  }
4915
4937
  static getCompilationHooks(compilation) {
4916
4938
  checkCompilation(compilation);
@@ -5046,7 +5068,7 @@ let lazyCompilationMiddlewareInternal = (compiler, activeModules, lazyCompilatio
5046
5068
  moduleActivated.length && compiler.watching && compiler.watching.invalidate(), res.writeHead(200), res.write('\n'), res.end();
5047
5069
  };
5048
5070
  };
5049
- class MangleExportsPlugin extends base_RspackBuiltinPlugin {
5071
+ class MangleExportsPlugin extends RspackBuiltinPlugin {
5050
5072
  deterministic;
5051
5073
  name = binding_namespaceObject.BuiltinPluginName.MangleExportsPlugin;
5052
5074
  affectedHooks = 'compilation';
@@ -5054,30 +5076,30 @@ class MangleExportsPlugin extends base_RspackBuiltinPlugin {
5054
5076
  super(), this.deterministic = deterministic;
5055
5077
  }
5056
5078
  raw() {
5057
- return base_createBuiltinPlugin(this.name, this.deterministic);
5079
+ return createBuiltinPlugin(this.name, this.deterministic);
5058
5080
  }
5059
5081
  }
5060
5082
  let MergeDuplicateChunksPlugin = base_create(binding_namespaceObject.BuiltinPluginName.MergeDuplicateChunksPlugin, ()=>{}), ModuleChunkFormatPlugin = base_create(binding_namespaceObject.BuiltinPluginName.ModuleChunkFormatPlugin, ()=>{});
5061
- class ModuleConcatenationPlugin extends base_RspackBuiltinPlugin {
5083
+ class ModuleConcatenationPlugin extends RspackBuiltinPlugin {
5062
5084
  name = binding_namespaceObject.BuiltinPluginName.ModuleConcatenationPlugin;
5063
5085
  affectedHooks = 'compilation';
5064
5086
  raw() {
5065
- return base_createBuiltinPlugin(this.name, void 0);
5087
+ return createBuiltinPlugin(this.name, void 0);
5066
5088
  }
5067
5089
  }
5068
5090
  let ModuleInfoHeaderPlugin = base_create(binding_namespaceObject.BuiltinPluginName.ModuleInfoHeaderPlugin, (verbose)=>verbose, 'compilation'), NamedChunkIdsPlugin = base_create(binding_namespaceObject.BuiltinPluginName.NamedChunkIdsPlugin, ()=>{}, 'compilation'), NamedModuleIdsPlugin = base_create(binding_namespaceObject.BuiltinPluginName.NamedModuleIdsPlugin, ()=>{}, 'compilation');
5069
- class NaturalChunkIdsPlugin extends base_RspackBuiltinPlugin {
5091
+ class NaturalChunkIdsPlugin extends RspackBuiltinPlugin {
5070
5092
  name = binding_namespaceObject.BuiltinPluginName.NaturalChunkIdsPlugin;
5071
5093
  affectedHooks = 'compilation';
5072
5094
  raw() {
5073
- return base_createBuiltinPlugin(this.name, void 0);
5095
+ return createBuiltinPlugin(this.name, void 0);
5074
5096
  }
5075
5097
  }
5076
- class NaturalModuleIdsPlugin extends base_RspackBuiltinPlugin {
5098
+ class NaturalModuleIdsPlugin extends RspackBuiltinPlugin {
5077
5099
  name = binding_namespaceObject.BuiltinPluginName.NaturalModuleIdsPlugin;
5078
5100
  affectedHooks = 'compilation';
5079
5101
  raw() {
5080
- return base_createBuiltinPlugin(this.name, void 0);
5102
+ return createBuiltinPlugin(this.name, void 0);
5081
5103
  }
5082
5104
  }
5083
5105
  let NodeTargetPlugin = base_create(binding_namespaceObject.BuiltinPluginName.NodeTargetPlugin, ()=>void 0), NoEmitOnErrorsPlugin = base_create(binding_namespaceObject.BuiltinPluginName.NoEmitOnErrorsPlugin, ()=>void 0), NormalModuleReplacementPlugin = base_create(binding_namespaceObject.BuiltinPluginName.NormalModuleReplacementPlugin, (resourceRegExp, newResource)=>({
@@ -5183,19 +5205,19 @@ class Coordinator {
5183
5205
  });
5184
5206
  }
5185
5207
  }
5186
- class RscClientPlugin extends base_RspackBuiltinPlugin {
5208
+ class RscClientPlugin extends RspackBuiltinPlugin {
5187
5209
  name = 'RscClientPlugin';
5188
5210
  #options;
5189
5211
  constructor(options){
5190
5212
  super(), this.#options = options;
5191
5213
  }
5192
5214
  raw(compiler) {
5193
- return this.#options.coordinator.applyClientCompiler(compiler), base_createBuiltinPlugin(this.name, {
5215
+ return this.#options.coordinator.applyClientCompiler(compiler), createBuiltinPlugin(this.name, {
5194
5216
  coordinator: this.#options.coordinator[GET_OR_INIT_BINDING]()
5195
5217
  });
5196
5218
  }
5197
5219
  }
5198
- class RscServerPlugin extends base_RspackBuiltinPlugin {
5220
+ class RscServerPlugin extends RspackBuiltinPlugin {
5199
5221
  name = 'RscServerPlugin';
5200
5222
  #options;
5201
5223
  constructor(options){
@@ -5205,7 +5227,7 @@ class RscServerPlugin extends base_RspackBuiltinPlugin {
5205
5227
  let onManifest;
5206
5228
  this.#options.coordinator.applyServerCompiler(compiler);
5207
5229
  let { coordinator, onServerComponentChanges } = this.#options;
5208
- return this.#options.onManifest && (onManifest = (json)=>Promise.resolve(this.#options.onManifest(JSON.parse(json)))), base_createBuiltinPlugin(this.name, {
5230
+ return this.#options.onManifest && (onManifest = (json)=>Promise.resolve(this.#options.onManifest(JSON.parse(json)))), createBuiltinPlugin(this.name, {
5209
5231
  coordinator: coordinator[GET_OR_INIT_BINDING](),
5210
5232
  cssLink: this.#options.cssLink,
5211
5233
  onServerComponentChanges,
@@ -5213,7 +5235,7 @@ class RscServerPlugin extends base_RspackBuiltinPlugin {
5213
5235
  });
5214
5236
  }
5215
5237
  }
5216
- class SideEffectsFlagPlugin extends base_RspackBuiltinPlugin {
5238
+ class SideEffectsFlagPlugin extends RspackBuiltinPlugin {
5217
5239
  analyzeSideEffectsFree;
5218
5240
  name = binding_namespaceObject.BuiltinPluginName.SideEffectsFlagPlugin;
5219
5241
  affectedHooks = 'compilation';
@@ -5221,7 +5243,7 @@ class SideEffectsFlagPlugin extends base_RspackBuiltinPlugin {
5221
5243
  super(), this.analyzeSideEffectsFree = analyzeSideEffectsFree;
5222
5244
  }
5223
5245
  raw() {
5224
- return base_createBuiltinPlugin(this.name, this.analyzeSideEffectsFree);
5246
+ return createBuiltinPlugin(this.name, this.analyzeSideEffectsFree);
5225
5247
  }
5226
5248
  }
5227
5249
  let SizeLimitsPlugin = base_create(binding_namespaceObject.BuiltinPluginName.SizeLimitsPlugin, (options)=>{
@@ -5413,7 +5435,7 @@ let SwcJsMinimizerRspackPlugin = base_create(binding_namespaceObject.BuiltinPlug
5413
5435
  }
5414
5436
  };
5415
5437
  }, 'compilation'), URLPlugin = base_create(binding_namespaceObject.BuiltinPluginName.URLPlugin, ()=>{}, 'compilation');
5416
- class WorkerPlugin extends base_RspackBuiltinPlugin {
5438
+ class WorkerPlugin extends RspackBuiltinPlugin {
5417
5439
  chunkLoading;
5418
5440
  wasmLoading;
5419
5441
  module;
@@ -5424,7 +5446,7 @@ class WorkerPlugin extends base_RspackBuiltinPlugin {
5424
5446
  super(), this.chunkLoading = chunkLoading, this.wasmLoading = wasmLoading, this.module = module, this.workerPublicPath = workerPublicPath;
5425
5447
  }
5426
5448
  raw(compiler) {
5427
- return this.chunkLoading && new EnableChunkLoadingPlugin(this.chunkLoading).apply(compiler), this.wasmLoading && new EnableWasmLoadingPlugin(this.wasmLoading).apply(compiler), base_createBuiltinPlugin(this.name, void 0);
5449
+ return this.chunkLoading && new EnableChunkLoadingPlugin(this.chunkLoading).apply(compiler), this.wasmLoading && new EnableWasmLoadingPlugin(this.wasmLoading).apply(compiler), createBuiltinPlugin(this.name, void 0);
5428
5450
  }
5429
5451
  }
5430
5452
  class ContextModuleFactory {
@@ -5926,6 +5948,35 @@ let configCache = {}, ES_VERSIONS_MAP = {
5926
5948
  9
5927
5949
  ]
5928
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
+ }),
5929
5980
  arrowFunction: rawChecker({
5930
5981
  chrome: 45,
5931
5982
  and_chr: 45,
@@ -6373,6 +6424,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
6373
6424
  importScriptsInWorker: !1,
6374
6425
  globalThis: v(12),
6375
6426
  const: v(6),
6427
+ computedProperty: v(4),
6376
6428
  templateLiteral: v(4),
6377
6429
  optionalChaining: v(14),
6378
6430
  methodShorthand: v(4),
@@ -6418,6 +6470,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
6418
6470
  importScriptsInWorker: !0,
6419
6471
  globalThis: v(5),
6420
6472
  const: v(1, 1),
6473
+ computedProperty: v(1, 1),
6421
6474
  templateLiteral: v(1, 1),
6422
6475
  optionalChaining: v(8),
6423
6476
  methodShorthand: v(1, 1),
@@ -6458,6 +6511,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
6458
6511
  require: !1,
6459
6512
  globalThis: v(0, 43),
6460
6513
  const: v(0, 15),
6514
+ computedProperty: v(0, 15),
6461
6515
  templateLiteral: v(0, 13),
6462
6516
  optionalChaining: v(0, 44),
6463
6517
  methodShorthand: v(0, 15),
@@ -6481,6 +6535,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
6481
6535
  return 5 < v && v < 1000 && (v += 2009), {
6482
6536
  esVersion: v > 2022 ? 2022 : v,
6483
6537
  const: v >= 2015,
6538
+ computedProperty: v >= 2015,
6484
6539
  templateLiteral: v >= 2015,
6485
6540
  optionalChaining: v >= 2020,
6486
6541
  methodShorthand: v >= 2015,
@@ -6600,6 +6655,8 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
6600
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));
6601
6656
  }, applySnapshotDefaults = (_snapshot, _env)=>{}, applyCssModuleGeneratorOptionsDefaults = (generatorOptions, { hashFunction, hashSalt, localIdentName, targetProperties })=>{
6602
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);
6603
6660
  }, applyModuleDefaults = (module, { asyncWebAssembly, targetProperties, mode, uniqueName, deferImport, outputModule, hashFunction, hashSalt })=>{
6604
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 })=>{
6605
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', [
@@ -6608,7 +6665,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
6608
6665
  })(module.parser.javascript, {
6609
6666
  deferImport,
6610
6667
  outputModule
6611
- }), 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']), D(module.parser['css/auto'], 'namedExports', !0), D(module.parser['css/auto'], 'url', !0), F(module.parser, 'css/global', ()=>({})), assertNotNill(module.parser['css/global']), D(module.parser['css/global'], 'namedExports', !0), D(module.parser['css/global'], 'url', !0), F(module.parser, 'css/module', ()=>({})), assertNotNill(module.parser['css/module']), D(module.parser['css/module'], 'namedExports', !0), D(module.parser['css/module'], 'url', !0), F(module.generator, 'css', ()=>({})), assertNotNill(module.generator.css), ((generatorOptions, { targetProperties })=>{
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 })=>{
6612
6669
  D(generatorOptions, 'exportsOnly', !targetProperties || !1 === targetProperties.document), D(generatorOptions, 'esModule', !0);
6613
6670
  })(module.generator.css, {
6614
6671
  targetProperties
@@ -6778,6 +6835,9 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
6778
6835
  }), F(environment, 'const', ()=>{
6779
6836
  let v;
6780
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);
6781
6841
  }), F(environment, 'methodShorthand', ()=>{
6782
6842
  let v;
6783
6843
  return tp && ((v = tp.methodShorthand) || void 0 === v);
@@ -6896,7 +6956,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
6896
6956
  return output.wasmLoading && enabledWasmLoadingTypes.add(output.wasmLoading), output.workerWasmLoading && enabledWasmLoadingTypes.add(output.workerWasmLoading), forEachEntry((desc)=>{
6897
6957
  desc.wasmLoading && enabledWasmLoadingTypes.add(desc.wasmLoading);
6898
6958
  }), Array.from(enabledWasmLoadingTypes);
6899
- }), D(output, 'bundlerInfo', {}), 'object' == typeof output.bundlerInfo && (D(output.bundlerInfo, 'version', "2.0.4"), D(output.bundlerInfo, 'bundler', 'rspack'), D(output.bundlerInfo, 'force', !1));
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));
6900
6960
  }, applyExternalsPresetsDefaults = (externalsPresets, { targetProperties, buildHttp, outputModule })=>{
6901
6961
  let isUniversal = (key)=>!!(outputModule && targetProperties && null === targetProperties[key]);
6902
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')));
@@ -8150,7 +8210,7 @@ class MultiStats {
8150
8210
  obj.children = this.stats.map((stat, idx)=>{
8151
8211
  let obj = stat.toJson(childOptions.children[idx]), compilationName = stat.compilation.name;
8152
8212
  return obj.name = compilationName && makePathsRelative(childOptions.context, compilationName, stat.compilation.compiler.root), obj;
8153
- }), childOptions.version && (obj.rspackVersion = "2.0.4", obj.version = "5.75.0"), childOptions.hash && (obj.hash = obj.children.map((j)=>j.hash).join(''));
8213
+ }), childOptions.version && (obj.rspackVersion = "2.0.5", obj.version = "5.75.0"), childOptions.hash && (obj.hash = obj.children.map((j)=>j.hash).join(''));
8154
8214
  let mapError = (j, obj)=>({
8155
8215
  ...obj,
8156
8216
  compilerPath: obj.compilerPath ? `${j.name}.${obj.compilerPath}` : j.name
@@ -9424,7 +9484,7 @@ let iterateConfig = (config, options, fn)=>{
9424
9484
  object.hash = context.getStatsCompilation(compilation).hash;
9425
9485
  },
9426
9486
  version: (object)=>{
9427
- object.version = "5.75.0", object.rspackVersion = "2.0.4";
9487
+ object.version = "5.75.0", object.rspackVersion = "2.0.5";
9428
9488
  },
9429
9489
  env: (object, _compilation, _context, { _env })=>{
9430
9490
  object.env = _env;
@@ -10650,8 +10710,9 @@ class RspackOptionsApply {
10650
10710
  process(options, compiler) {
10651
10711
  if (!options.output.path) throw Error('options.output.path should have a value after `applyRspackOptionsDefaults`');
10652
10712
  if (compiler.outputPath = options.output.path, compiler.name = options.name, compiler.outputFileSystem = node_fs, options.externals) {
10713
+ let presets;
10653
10714
  if (!options.externalsType) throw Error('options.externalsType should have a value after `applyRspackOptionsDefaults`');
10654
- 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);
10655
10716
  }
10656
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){
10657
10718
  case 'array-push':
@@ -10686,7 +10747,7 @@ class RspackOptionsApply {
10686
10747
  moduleFilenameTemplate: options.output.devtoolModuleFilenameTemplate,
10687
10748
  namespace: options.output.devtoolNamespace
10688
10749
  }).apply(compiler);
10689
- 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);
10690
10751
  let enableLibSplitChunks = !1;
10691
10752
  if (options.output.enabledLibraryTypes && options.output.enabledLibraryTypes.length > 0) {
10692
10753
  let hasModernModule = options.output.enabledLibraryTypes.includes('modern-module'), hasNonModernModule = options.output.enabledLibraryTypes.some((t)=>'modern-module' !== t);
@@ -11082,7 +11143,7 @@ class TraceHookPlugin {
11082
11143
  });
11083
11144
  }
11084
11145
  }
11085
- let CORE_VERSION = "2.0.4", VFILES_BY_COMPILER = new WeakMap();
11146
+ let CORE_VERSION = "2.0.5", VFILES_BY_COMPILER = new WeakMap();
11086
11147
  class VirtualModulesPlugin {
11087
11148
  #staticModules;
11088
11149
  #compiler;
@@ -11647,6 +11708,7 @@ Help:
11647
11708
  environment: function(environment = {}) {
11648
11709
  return {
11649
11710
  const: !!environment.const,
11711
+ computedProperty: !!environment.computedProperty,
11650
11712
  methodShorthand: !!environment.methodShorthand,
11651
11713
  arrowFunction: !!environment.arrowFunction,
11652
11714
  nodePrefixForCoreModules: !!environment.nodePrefixForCoreModules,
@@ -12559,14 +12621,14 @@ let parseOptions = (options, normalizeSimple, normalizeOptions)=>{
12559
12621
  else throw Error('Unexpected options format');
12560
12622
  return items;
12561
12623
  }, compilerSet = new WeakSet();
12562
- class ShareRuntimePlugin extends base_RspackBuiltinPlugin {
12624
+ class ShareRuntimePlugin extends RspackBuiltinPlugin {
12563
12625
  enhanced;
12564
12626
  name = binding_namespaceObject.BuiltinPluginName.ShareRuntimePlugin;
12565
12627
  constructor(enhanced = !1){
12566
12628
  super(), this.enhanced = enhanced;
12567
12629
  }
12568
12630
  raw(compiler) {
12569
- if (!compilerSet.has(compiler)) return compilerSet.add(compiler), base_createBuiltinPlugin(this.name, this.enhanced);
12631
+ if (!compilerSet.has(compiler)) return compilerSet.add(compiler), createBuiltinPlugin(this.name, this.enhanced);
12570
12632
  }
12571
12633
  }
12572
12634
  let VERSION_PATTERN_REGEXP = /^([\d^=v<>~]|[*xX]$)/;
@@ -12612,7 +12674,7 @@ function normalizeConsumeShareOptions(consumes, shareScope) {
12612
12674
  treeShakingMode: item.treeShakingMode
12613
12675
  }));
12614
12676
  }
12615
- class ConsumeSharedPlugin extends base_RspackBuiltinPlugin {
12677
+ class ConsumeSharedPlugin extends RspackBuiltinPlugin {
12616
12678
  name = binding_namespaceObject.BuiltinPluginName.ConsumeSharedPlugin;
12617
12679
  _options;
12618
12680
  constructor(options){
@@ -12630,10 +12692,10 @@ class ConsumeSharedPlugin extends base_RspackBuiltinPlugin {
12630
12692
  })),
12631
12693
  enhanced: this._options.enhanced
12632
12694
  };
12633
- return base_createBuiltinPlugin(this.name, rawOptions);
12695
+ return createBuiltinPlugin(this.name, rawOptions);
12634
12696
  }
12635
12697
  }
12636
- class ProvideSharedPlugin extends base_RspackBuiltinPlugin {
12698
+ class ProvideSharedPlugin extends RspackBuiltinPlugin {
12637
12699
  name = binding_namespaceObject.BuiltinPluginName.ProvideSharedPlugin;
12638
12700
  _provides;
12639
12701
  _enhanced;
@@ -12669,7 +12731,7 @@ class ProvideSharedPlugin extends base_RspackBuiltinPlugin {
12669
12731
  key,
12670
12732
  ...v
12671
12733
  }));
12672
- return base_createBuiltinPlugin(this.name, rawOptions);
12734
+ return createBuiltinPlugin(this.name, rawOptions);
12673
12735
  }
12674
12736
  }
12675
12737
  function validateShareScope(shareScope, enhanced, pluginName) {
@@ -12753,7 +12815,7 @@ function getFileName(manifestOptions) {
12753
12815
  manifestFileName: join(filePath, manifestFileName)
12754
12816
  };
12755
12817
  }
12756
- class ModuleFederationManifestPlugin extends base_RspackBuiltinPlugin {
12818
+ class ModuleFederationManifestPlugin extends RspackBuiltinPlugin {
12757
12819
  name = binding_namespaceObject.BuiltinPluginName.ModuleFederationManifestPlugin;
12758
12820
  rawOpts;
12759
12821
  constructor(opts){
@@ -12855,11 +12917,11 @@ class ModuleFederationManifestPlugin extends base_RspackBuiltinPlugin {
12855
12917
  buildName: process.env.MF_BUILD_NAME || pkg?.name || 'UNKNOWN'
12856
12918
  }, Object.values(normalizeSharedOptions(mfConfig1.shared || {})).some((config)=>config[1].treeShaking) && (statsBuildInfo.target = Array.isArray(compiler.options.target) ? compiler.options.target : [], statsBuildInfo.plugins = mfConfig1.treeShakingSharedPlugins || [], statsBuildInfo.excludePlugins = mfConfig1.treeShakingSharedExcludePlugins || []), statsBuildInfo)
12857
12919
  };
12858
- return base_createBuiltinPlugin(this.name, rawOptions);
12920
+ return createBuiltinPlugin(this.name, rawOptions);
12859
12921
  }
12860
12922
  }
12861
12923
  let SHARE_ENTRY_ASSET = 'collect-shared-entries.json';
12862
- class CollectSharedEntryPlugin extends base_RspackBuiltinPlugin {
12924
+ class CollectSharedEntryPlugin extends RspackBuiltinPlugin {
12863
12925
  name = binding_namespaceObject.BuiltinPluginName.CollectSharedEntryPlugin;
12864
12926
  sharedOptions;
12865
12927
  _collectedEntries;
@@ -12894,13 +12956,13 @@ class CollectSharedEntryPlugin extends base_RspackBuiltinPlugin {
12894
12956
  })),
12895
12957
  filename: this.getFilename()
12896
12958
  };
12897
- return base_createBuiltinPlugin(this.name, rawOptions);
12959
+ return createBuiltinPlugin(this.name, rawOptions);
12898
12960
  }
12899
12961
  }
12900
12962
  function assert(condition, msg) {
12901
12963
  if (!condition) throw Error(msg);
12902
12964
  }
12903
- class SharedContainerPlugin extends base_RspackBuiltinPlugin {
12965
+ class SharedContainerPlugin extends RspackBuiltinPlugin {
12904
12966
  name = binding_namespaceObject.BuiltinPluginName.SharedContainerPlugin;
12905
12967
  filename = '';
12906
12968
  _options;
@@ -12934,7 +12996,7 @@ class SharedContainerPlugin extends base_RspackBuiltinPlugin {
12934
12996
  }
12935
12997
  raw(compiler) {
12936
12998
  let { library } = this._options;
12937
- return compiler.options.output.enabledLibraryTypes.includes(library.type) || compiler.options.output.enabledLibraryTypes.push(library.type), base_createBuiltinPlugin(this.name, this._options);
12999
+ return compiler.options.output.enabledLibraryTypes.includes(library.type) || compiler.options.output.enabledLibraryTypes.push(library.type), createBuiltinPlugin(this.name, this._options);
12938
13000
  }
12939
13001
  apply(compiler) {
12940
13002
  super.apply(compiler);
@@ -12952,7 +13014,7 @@ class SharedContainerPlugin extends base_RspackBuiltinPlugin {
12952
13014
  });
12953
13015
  }
12954
13016
  }
12955
- class SharedUsedExportsOptimizerPlugin extends base_RspackBuiltinPlugin {
13017
+ class SharedUsedExportsOptimizerPlugin extends RspackBuiltinPlugin {
12956
13018
  name = binding_namespaceObject.BuiltinPluginName.SharedUsedExportsOptimizerPlugin;
12957
13019
  sharedOptions;
12958
13020
  injectTreeShakingUsedExports;
@@ -12974,7 +13036,7 @@ class SharedUsedExportsOptimizerPlugin extends base_RspackBuiltinPlugin {
12974
13036
  };
12975
13037
  }
12976
13038
  raw() {
12977
- if (this.sharedOptions.length) return base_createBuiltinPlugin(this.name, this.buildOptions());
13039
+ if (this.sharedOptions.length) return createBuiltinPlugin(this.name, this.buildOptions());
12978
13040
  }
12979
13041
  }
12980
13042
  let VIRTUAL_ENTRY = './virtual-entry.js', VIRTUAL_ENTRY_NAME = 'virtual-entry';
@@ -13283,7 +13345,7 @@ function getDefaultEntryRuntime(paths, options, compiler, treeShakingShareFallba
13283
13345
  ].join(';');
13284
13346
  return `@module-federation/runtime/rspack.js!=!data:text/javascript,${encodeURIComponent(content)}`;
13285
13347
  }
13286
- class ContainerPlugin extends base_RspackBuiltinPlugin {
13348
+ class ContainerPlugin extends RspackBuiltinPlugin {
13287
13349
  name = binding_namespaceObject.BuiltinPluginName.ContainerPlugin;
13288
13350
  _options;
13289
13351
  constructor(options){
@@ -13327,10 +13389,10 @@ class ContainerPlugin extends base_RspackBuiltinPlugin {
13327
13389
  })),
13328
13390
  enhanced
13329
13391
  };
13330
- return base_createBuiltinPlugin(this.name, rawOptions);
13392
+ return createBuiltinPlugin(this.name, rawOptions);
13331
13393
  }
13332
13394
  }
13333
- class ContainerReferencePlugin extends base_RspackBuiltinPlugin {
13395
+ class ContainerReferencePlugin extends RspackBuiltinPlugin {
13334
13396
  name = binding_namespaceObject.BuiltinPluginName.ContainerReferencePlugin;
13335
13397
  _options;
13336
13398
  constructor(options){
@@ -13374,7 +13436,7 @@ class ContainerReferencePlugin extends base_RspackBuiltinPlugin {
13374
13436
  })),
13375
13437
  enhanced: this._options.enhanced
13376
13438
  };
13377
- return base_createBuiltinPlugin(this.name, rawOptions);
13439
+ return createBuiltinPlugin(this.name, rawOptions);
13378
13440
  }
13379
13441
  }
13380
13442
  async function minify(source, options) {
@@ -13385,7 +13447,7 @@ async function transform(source, options) {
13385
13447
  let _options = JSON.stringify(options || {});
13386
13448
  return binding_default().transform(source, _options);
13387
13449
  }
13388
- let exports_rspackVersion = "2.0.4", exports_version = "5.75.0", exports_WebpackError = Error, exports_config = {
13450
+ let exports_rspackVersion = "2.0.5", exports_version = "5.75.0", exports_WebpackError = Error, exports_config = {
13389
13451
  getNormalizedRspackOptions: getNormalizedRspackOptions,
13390
13452
  applyRspackOptionsDefaults: applyRspackOptionsDefaults,
13391
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.4",
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,7 +37,7 @@
37
37
  "directory": "packages/rspack"
38
38
  },
39
39
  "devDependencies": {
40
- "@ast-grep/napi": "^0.42.2",
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
43
  "@rslib/core": "^0.21.5",
@@ -58,11 +58,11 @@
58
58
  "webpack-sources": "3.3.4"
59
59
  },
60
60
  "dependencies": {
61
- "@rspack/binding": "2.0.4"
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": ">=0.5.1"
65
+ "@swc/helpers": "^0.5.23"
66
66
  },
67
67
  "peerDependenciesMeta": {
68
68
  "@module-federation/runtime-tools": {