@rspack/core 1.0.12 → 1.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Compiler.d.ts +0 -1
- package/dist/FileSystem.d.ts +0 -1
- package/dist/NormalModule.d.ts +2 -7
- package/dist/RuntimeGlobals.d.ts +1 -1
- package/dist/builtin-plugin/APIPlugin.d.ts +2 -2
- package/dist/builtin-plugin/ArrayPushCallbackChunkFormatPlugin.d.ts +2 -2
- package/dist/builtin-plugin/AssetModulesPlugin.d.ts +2 -2
- package/dist/builtin-plugin/AsyncWebAssemblyModulesPlugin.d.ts +2 -2
- package/dist/builtin-plugin/BannerPlugin.d.ts +2 -2
- package/dist/builtin-plugin/BundlerInfoRspackPlugin.d.ts +2 -2
- package/dist/builtin-plugin/ChunkPrefetchPreloadPlugin.d.ts +2 -2
- package/dist/builtin-plugin/CommonJsChunkFormatPlugin.d.ts +2 -2
- package/dist/builtin-plugin/ContextReplacementPlugin.d.ts +2 -2
- package/dist/builtin-plugin/CopyRspackPlugin.d.ts +2 -2
- package/dist/builtin-plugin/CssModulesPlugin.d.ts +2 -2
- package/dist/builtin-plugin/DataUriPlugin.d.ts +2 -2
- package/dist/builtin-plugin/DefinePlugin.d.ts +2 -2
- package/dist/builtin-plugin/DeterministicChunkIdsPlugin.d.ts +2 -2
- package/dist/builtin-plugin/DeterministicModuleIdsPlugin.d.ts +2 -2
- package/dist/builtin-plugin/ElectronTargetPlugin.d.ts +2 -2
- package/dist/builtin-plugin/EnableChunkLoadingPlugin.d.ts +2 -2
- package/dist/builtin-plugin/EnableWasmLoadingPlugin.d.ts +2 -2
- package/dist/builtin-plugin/EnsureChunkConditionsPlugin.d.ts +2 -2
- package/dist/builtin-plugin/EntryPlugin.d.ts +2 -2
- package/dist/builtin-plugin/EvalDevToolModulePlugin.d.ts +2 -2
- package/dist/builtin-plugin/EvalSourceMapDevToolPlugin.d.ts +2 -2
- package/dist/builtin-plugin/ExternalsPlugin.d.ts +2 -2
- package/dist/builtin-plugin/FetchCompileAsyncWasmPlugin.d.ts +2 -2
- package/dist/builtin-plugin/FileUriPlugin.d.ts +2 -2
- package/dist/builtin-plugin/FlagDependencyExportsPlugin.d.ts +2 -2
- package/dist/builtin-plugin/FlagDependencyUsagePlugin.d.ts +2 -2
- package/dist/builtin-plugin/HtmlRspackPlugin.d.ts +15 -9
- package/dist/builtin-plugin/HttpExternalsRspackPlugin.d.ts +2 -2
- package/dist/builtin-plugin/IgnorePlugin.d.ts +2 -2
- package/dist/builtin-plugin/InferAsyncModulesPlugin.d.ts +2 -2
- package/dist/builtin-plugin/JsonModulesPlugin.d.ts +2 -2
- package/dist/builtin-plugin/LightningCssMiminizerRspackPlugin.d.ts +2 -2
- package/dist/builtin-plugin/LimitChunkCountPlugin.d.ts +2 -2
- package/dist/builtin-plugin/MangleExportsPlugin.d.ts +2 -2
- package/dist/builtin-plugin/MergeDuplicateChunksPlugin.d.ts +2 -2
- package/dist/builtin-plugin/ModuleChunkFormatPlugin.d.ts +2 -2
- package/dist/builtin-plugin/ModuleConcatenationPlugin.d.ts +2 -2
- package/dist/builtin-plugin/NamedChunkIdsPlugin.d.ts +2 -2
- package/dist/builtin-plugin/NamedModuleIdsPlugin.d.ts +2 -2
- package/dist/builtin-plugin/NaturalChunkIdsPlugin.d.ts +2 -2
- package/dist/builtin-plugin/NaturalModuleIdsPlugin.d.ts +2 -2
- package/dist/builtin-plugin/NoEmitOnErrorsPlugin.d.ts +2 -2
- package/dist/builtin-plugin/NodeTargetPlugin.d.ts +2 -2
- package/dist/builtin-plugin/ProgressPlugin.d.ts +2 -2
- package/dist/builtin-plugin/ProvidePlugin.d.ts +2 -2
- package/dist/builtin-plugin/RealContentHashPlugin.d.ts +2 -2
- package/dist/builtin-plugin/RemoveEmptyChunksPlugin.d.ts +2 -2
- package/dist/builtin-plugin/RuntimeChunkPlugin.d.ts +2 -2
- package/dist/builtin-plugin/RuntimePlugin.d.ts +2 -2
- package/dist/builtin-plugin/SideEffectsFlagPlugin.d.ts +2 -2
- package/dist/builtin-plugin/SizeLimitsPlugin.d.ts +4 -4
- package/dist/builtin-plugin/SourceMapDevToolPlugin.d.ts +2 -2
- package/dist/builtin-plugin/SwcJsMinimizerPlugin.d.ts +2 -2
- package/dist/builtin-plugin/WarnCaseSensitiveModulesPlugin.d.ts +2 -2
- package/dist/builtin-plugin/WebWorkerTemplatePlugin.d.ts +2 -2
- package/dist/builtin-plugin/css-extract/loader.d.ts +1 -1
- package/dist/builtin-plugin/lazy-compilation/backend.d.ts +1 -5
- package/dist/builtin-plugin/lazy-compilation/lazyCompilation.d.ts +2 -2
- package/dist/config/adapterRuleUse.d.ts +0 -1
- package/dist/config/types.d.ts +809 -1
- package/dist/config/zod.d.ts +261 -3709
- package/dist/container/ModuleFederationRuntimePlugin.d.ts +2 -2
- package/dist/exports.d.ts +2 -2
- package/dist/index.js +51 -20
- package/dist/lib/HookWebpackError.d.ts +1 -1
- package/dist/lib/WebpackError.d.ts +0 -1
- package/dist/node/nodeConsole.d.ts +0 -1
- package/dist/stats/statsFactoryUtils.d.ts +1 -2
- package/dist/util/fs.d.ts +0 -3
- package/dist/util/hash/BatchedHash.d.ts +0 -1
- package/dist/util/hash/index.d.ts +0 -1
- package/dist/util/hash/wasm-hash.d.ts +0 -1
- package/dist/util/identifier.d.ts +8 -8
- package/dist/util/index.d.ts +0 -1
- package/dist/util/memoize.d.ts +1 -1
- package/dist/util/webpack.d.ts +1 -1
- package/package.json +3 -3
package/dist/config/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { JsAssetInfo } from "@rspack/binding";
|
|
1
|
+
import type { JsAssetInfo, RawFuncUseCtx } from "@rspack/binding";
|
|
2
2
|
import type { PathData } from "../Compilation";
|
|
3
3
|
import type { Compiler } from "../Compiler";
|
|
4
4
|
import type { Module } from "../Module";
|
|
@@ -548,6 +548,317 @@ export type ResolveOptions = {
|
|
|
548
548
|
};
|
|
549
549
|
/** Used to configure the Rspack module resolution */
|
|
550
550
|
export type Resolve = ResolveOptions;
|
|
551
|
+
export type RuleSetCondition = string | RegExp | ((value: string) => boolean) | RuleSetConditions | RuleSetLogicalConditions;
|
|
552
|
+
export type RuleSetConditions = RuleSetCondition[];
|
|
553
|
+
export type RuleSetLogicalConditions = {
|
|
554
|
+
and?: RuleSetConditions;
|
|
555
|
+
or?: RuleSetConditions;
|
|
556
|
+
not?: RuleSetCondition;
|
|
557
|
+
};
|
|
558
|
+
export type RuleSetLoader = string;
|
|
559
|
+
export type RuleSetLoaderOptions = string | Record<string, any>;
|
|
560
|
+
export type RuleSetLoaderWithOptions = {
|
|
561
|
+
ident?: string;
|
|
562
|
+
loader: RuleSetLoader;
|
|
563
|
+
options?: RuleSetLoaderOptions;
|
|
564
|
+
};
|
|
565
|
+
export type RuleSetUseItem = RuleSetLoader | RuleSetLoaderWithOptions;
|
|
566
|
+
export type RuleSetUse = RuleSetUseItem | RuleSetUseItem[] | ((data: RawFuncUseCtx) => RuleSetUseItem[]);
|
|
567
|
+
/** Rule defines the conditions for matching a module and the behavior of handling those modules. */
|
|
568
|
+
export type RuleSetRule = {
|
|
569
|
+
/** Matches all modules that match this resource, and will match against Resource. */
|
|
570
|
+
test?: RuleSetCondition;
|
|
571
|
+
/** Excludes all modules that match this condition and will match against the absolute path of the resource */
|
|
572
|
+
exclude?: RuleSetCondition;
|
|
573
|
+
/** Matches all modules that match this condition against the absolute path of the resource */
|
|
574
|
+
include?: RuleSetCondition;
|
|
575
|
+
/** Matches all modules that match this resource, and will match against Resource */
|
|
576
|
+
issuer?: RuleSetCondition;
|
|
577
|
+
/** Matches all modules that match this resource, and will match against layer of the module that issued the current module. */
|
|
578
|
+
issuerLayer?: RuleSetCondition;
|
|
579
|
+
/** Matches all modules that match this resource, and will match against the category of the dependency that introduced the current module */
|
|
580
|
+
dependency?: RuleSetCondition;
|
|
581
|
+
/** Matches all modules that match this resource, and will match against Resource */
|
|
582
|
+
resource?: RuleSetCondition;
|
|
583
|
+
/** Matches all modules that match this resource against the Resource's fragment. */
|
|
584
|
+
resourceFragment?: RuleSetCondition;
|
|
585
|
+
/** Matches all modules that match this resource against the Resource's query. */
|
|
586
|
+
resourceQuery?: RuleSetCondition;
|
|
587
|
+
/** Matches all modules that match this resource, and will match against the Resource's mimetype. */
|
|
588
|
+
mimetype?: RuleSetCondition;
|
|
589
|
+
/** Matches all modules that match this resource, and will match against the Resource's scheme. */
|
|
590
|
+
scheme?: RuleSetCondition;
|
|
591
|
+
/** Allows you to match values of properties in the description file, typically package.json, to determine which modules a rule should apply to. */
|
|
592
|
+
descriptionData?: Record<string, RuleSetCondition>;
|
|
593
|
+
/** Used in conjunction with [import attributes](https://github.com/tc39/proposal-import-attributes). */
|
|
594
|
+
with?: Record<string, RuleSetCondition>;
|
|
595
|
+
/** Used to mark the type of the matching module, which affects how the module is handled by Rspack's built-in processing. */
|
|
596
|
+
type?: string;
|
|
597
|
+
/** Used to mark the layer of the matching module. */
|
|
598
|
+
layer?: string;
|
|
599
|
+
/** A loader name */
|
|
600
|
+
loader?: RuleSetLoader;
|
|
601
|
+
/** A loader options */
|
|
602
|
+
options?: RuleSetLoaderOptions;
|
|
603
|
+
/** An array to pass the Loader package name and its options. */
|
|
604
|
+
use?: RuleSetUse;
|
|
605
|
+
/**
|
|
606
|
+
* Parser options for the specific modules that matched by the rule conditions
|
|
607
|
+
* It will override the parser options in module.parser.
|
|
608
|
+
* @default {}
|
|
609
|
+
* */
|
|
610
|
+
parser?: Record<string, any>;
|
|
611
|
+
/**
|
|
612
|
+
* Generator options for the specific modules that matched by the rule conditions
|
|
613
|
+
* It will override the parser options in module.generator.
|
|
614
|
+
* @default {}
|
|
615
|
+
*/
|
|
616
|
+
generator?: Record<string, any>;
|
|
617
|
+
/** Matches all modules that match this resource, and will match against Resource. */
|
|
618
|
+
resolve?: ResolveOptions;
|
|
619
|
+
/** Flag the module for side effects */
|
|
620
|
+
sideEffects?: boolean;
|
|
621
|
+
/** Specify loader category. */
|
|
622
|
+
enforce?: "pre" | "post";
|
|
623
|
+
/** A kind of Nested Rule, an array of Rules from which only the first matching Rule is used when the parent Rule matches. */
|
|
624
|
+
oneOf?: RuleSetRule[];
|
|
625
|
+
/** A kind of Nested Rule, an array of Rules that is also used when the parent Rule matches. */
|
|
626
|
+
rules?: RuleSetRule[];
|
|
627
|
+
};
|
|
628
|
+
/** A list of rules. */
|
|
629
|
+
export type RuleSetRules = ("..." | RuleSetRule | Falsy)[];
|
|
630
|
+
/**
|
|
631
|
+
* Options object for DataUrl condition.
|
|
632
|
+
* */
|
|
633
|
+
export type AssetParserDataUrlOptions = {
|
|
634
|
+
maxSize?: number | undefined;
|
|
635
|
+
};
|
|
636
|
+
/**
|
|
637
|
+
* Options object for DataUrl condition.
|
|
638
|
+
* */
|
|
639
|
+
export type AssetParserDataUrl = AssetParserDataUrlOptions;
|
|
640
|
+
/** Options object for `asset` modules. */
|
|
641
|
+
export type AssetParserOptions = {
|
|
642
|
+
/**
|
|
643
|
+
* It be used only for Asset Module scenarios.
|
|
644
|
+
* @default { maxSize: 8096 }
|
|
645
|
+
* */
|
|
646
|
+
dataUrlCondition?: AssetParserDataUrlOptions;
|
|
647
|
+
};
|
|
648
|
+
export type CssParserNamedExports = boolean;
|
|
649
|
+
/** Options object for `css` modules. */
|
|
650
|
+
export type CssParserOptions = {
|
|
651
|
+
/**
|
|
652
|
+
* Use ES modules named export for CSS exports.
|
|
653
|
+
* @default true
|
|
654
|
+
* */
|
|
655
|
+
namedExports?: CssParserNamedExports;
|
|
656
|
+
};
|
|
657
|
+
/** Options object for `css/auto` modules. */
|
|
658
|
+
export type CssAutoParserOptions = {
|
|
659
|
+
/**
|
|
660
|
+
* Use ES modules named export for CSS exports.
|
|
661
|
+
* @default true
|
|
662
|
+
* */
|
|
663
|
+
namedExports?: CssParserNamedExports;
|
|
664
|
+
};
|
|
665
|
+
/** Options object for `css/module` modules. */
|
|
666
|
+
export type CssModuleParserOptions = {
|
|
667
|
+
/**
|
|
668
|
+
* Use ES modules named export for CSS exports.
|
|
669
|
+
* @default true
|
|
670
|
+
* */
|
|
671
|
+
namedExports?: CssParserNamedExports;
|
|
672
|
+
};
|
|
673
|
+
type ExportsPresence = "error" | "warn" | "auto" | false;
|
|
674
|
+
export type JavascriptParserOptions = {
|
|
675
|
+
/**
|
|
676
|
+
* Specifies global mode for dynamic import.
|
|
677
|
+
* @default 'lazy'
|
|
678
|
+
* */
|
|
679
|
+
dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once";
|
|
680
|
+
/**
|
|
681
|
+
* Specifies global preload for dynamic import.
|
|
682
|
+
* @default false
|
|
683
|
+
* */
|
|
684
|
+
dynamicImportPreload?: boolean | number;
|
|
685
|
+
/**
|
|
686
|
+
* Specifies global prefetch for dynamic import
|
|
687
|
+
* @default false
|
|
688
|
+
* */
|
|
689
|
+
dynamicImportPrefetch?: boolean | number;
|
|
690
|
+
/**
|
|
691
|
+
* Specifies global fetchPriority for dynamic import
|
|
692
|
+
* @default 'auto'
|
|
693
|
+
*/
|
|
694
|
+
dynamicImportFetchPriority?: "low" | "high" | "auto";
|
|
695
|
+
/**
|
|
696
|
+
* Enable or disable evaluating import.meta.
|
|
697
|
+
* @default true
|
|
698
|
+
*/
|
|
699
|
+
importMeta?: boolean;
|
|
700
|
+
/**
|
|
701
|
+
* Enable parsing of new URL() syntax.
|
|
702
|
+
* @default true
|
|
703
|
+
* */
|
|
704
|
+
url?: "relative" | boolean;
|
|
705
|
+
/**
|
|
706
|
+
* Enable warnings for full dynamic dependencies
|
|
707
|
+
* @default true
|
|
708
|
+
* */
|
|
709
|
+
exprContextCritical?: boolean;
|
|
710
|
+
/**
|
|
711
|
+
* Enable warnings for partial dynamic dependencies
|
|
712
|
+
* @default false
|
|
713
|
+
* */
|
|
714
|
+
wrappedContextCritical?: boolean;
|
|
715
|
+
/**
|
|
716
|
+
* Warn or error for using non-existent exports and conflicting re-exports.
|
|
717
|
+
* @default 'auto'
|
|
718
|
+
*/
|
|
719
|
+
exportsPresence?: ExportsPresence;
|
|
720
|
+
/** Warn or error for using non-existent exports */
|
|
721
|
+
importExportsPresence?: ExportsPresence;
|
|
722
|
+
/** Warn or error for conflicting re-exports */
|
|
723
|
+
reexportExportsPresence?: ExportsPresence;
|
|
724
|
+
/** Emit errors instead of warnings when imported names don't exist in imported module. */
|
|
725
|
+
strictExportPresence?: boolean;
|
|
726
|
+
/** Provide custom syntax for Worker parsing, commonly used to support Worklet */
|
|
727
|
+
worker?: string[] | boolean;
|
|
728
|
+
/** Override the module to strict or non-strict. */
|
|
729
|
+
overrideStrict?: "strict" | "non-strict";
|
|
730
|
+
requireAsExpression?: boolean;
|
|
731
|
+
requireDynamic?: boolean;
|
|
732
|
+
requireResolve?: boolean;
|
|
733
|
+
importDynamic?: boolean;
|
|
734
|
+
};
|
|
735
|
+
/** Configure all parsers' options in one place with module.parser. */
|
|
736
|
+
export type ParserOptionsByModuleTypeKnown = {
|
|
737
|
+
/** Parser options for `asset` modules. */
|
|
738
|
+
asset?: AssetParserOptions;
|
|
739
|
+
/** Parser options for `css` modules. */
|
|
740
|
+
css?: CssParserOptions;
|
|
741
|
+
/** Parser options for `css/auto` modules. */
|
|
742
|
+
"css/auto"?: CssAutoParserOptions;
|
|
743
|
+
/** Parser options for `css/module` modules. */
|
|
744
|
+
"css/module"?: CssModuleParserOptions;
|
|
745
|
+
/** Parser options for `javascript` modules. */
|
|
746
|
+
javascript?: JavascriptParserOptions;
|
|
747
|
+
/** Parser options for `javascript/auto` modules. */
|
|
748
|
+
"javascript/auto"?: JavascriptParserOptions;
|
|
749
|
+
/** Parser options for `javascript/dynamic` modules. */
|
|
750
|
+
"javascript/dynamic"?: JavascriptParserOptions;
|
|
751
|
+
/** Parser options for `javascript/esm` modules. */
|
|
752
|
+
"javascript/esm"?: JavascriptParserOptions;
|
|
753
|
+
};
|
|
754
|
+
/** Configure all parsers' options in one place with module.parser. */
|
|
755
|
+
export type ParserOptionsByModuleTypeUnknown = {
|
|
756
|
+
[x: string]: Record<string, any>;
|
|
757
|
+
};
|
|
758
|
+
/** Configure all parsers' options in one place with module.parser. */
|
|
759
|
+
export type ParserOptionsByModuleType = ParserOptionsByModuleTypeKnown | ParserOptionsByModuleTypeUnknown;
|
|
760
|
+
export type AssetGeneratorDataUrlOptions = {
|
|
761
|
+
encoding?: false | "base64";
|
|
762
|
+
mimetype?: string;
|
|
763
|
+
};
|
|
764
|
+
export type AssetGeneratorDataUrlFunction = (options: {
|
|
765
|
+
filename: string;
|
|
766
|
+
content: string;
|
|
767
|
+
}) => string;
|
|
768
|
+
export type AssetGeneratorDataUrl = AssetGeneratorDataUrlOptions | AssetGeneratorDataUrlFunction;
|
|
769
|
+
/** Options for asset inline modules. */
|
|
770
|
+
export type AssetInlineGeneratorOptions = {
|
|
771
|
+
/** Only for modules with module type 'asset' or 'asset/inline'. */
|
|
772
|
+
dataUrl?: AssetGeneratorDataUrl;
|
|
773
|
+
};
|
|
774
|
+
/** Options for asset modules. */
|
|
775
|
+
export type AssetResourceGeneratorOptions = {
|
|
776
|
+
/**
|
|
777
|
+
* Whether to output assets to disk.
|
|
778
|
+
* @default true
|
|
779
|
+
* */
|
|
780
|
+
emit?: boolean;
|
|
781
|
+
/** This option determines the name of each asset resource output bundle.*/
|
|
782
|
+
filename?: Filename;
|
|
783
|
+
/** This option determines the URL prefix of the referenced 'asset' or 'asset/resource'*/
|
|
784
|
+
publicPath?: PublicPath;
|
|
785
|
+
};
|
|
786
|
+
/** Generator options for asset modules. */
|
|
787
|
+
export type AssetGeneratorOptions = AssetInlineGeneratorOptions & AssetResourceGeneratorOptions;
|
|
788
|
+
export type CssGeneratorExportsConvention = "as-is" | "camel-case" | "camel-case-only" | "dashes" | "dashes-only";
|
|
789
|
+
export type CssGeneratorExportsOnly = boolean;
|
|
790
|
+
export type CssGeneratorLocalIdentName = string;
|
|
791
|
+
export type CssGeneratorEsModule = boolean;
|
|
792
|
+
/** Generator options for css modules. */
|
|
793
|
+
export type CssGeneratorOptions = {
|
|
794
|
+
/**
|
|
795
|
+
* If true, only exports the identifier mappings from CSS into the output JavaScript files
|
|
796
|
+
* If false, generate stylesheets and embed them in the template.
|
|
797
|
+
*/
|
|
798
|
+
exportsOnly?: CssGeneratorExportsOnly;
|
|
799
|
+
/** This configuration is available for improved ESM-CJS interoperability purposes. */
|
|
800
|
+
esModule?: CssGeneratorEsModule;
|
|
801
|
+
};
|
|
802
|
+
/** Generator options for css/auto modules. */
|
|
803
|
+
export type CssAutoGeneratorOptions = {
|
|
804
|
+
/**
|
|
805
|
+
* Customize how CSS export names are exported to javascript modules
|
|
806
|
+
* @default 'as-is'
|
|
807
|
+
* */
|
|
808
|
+
exportsConvention?: CssGeneratorExportsConvention;
|
|
809
|
+
/**
|
|
810
|
+
* If true, only exports the identifier mappings from CSS into the output JavaScript files
|
|
811
|
+
* If false, generate stylesheets and embed them in the template.
|
|
812
|
+
*/
|
|
813
|
+
exportsOnly?: CssGeneratorExportsOnly;
|
|
814
|
+
/** Customize the format of the local class names generated for CSS modules */
|
|
815
|
+
localIdentName?: CssGeneratorLocalIdentName;
|
|
816
|
+
/** This configuration is available for improved ESM-CJS interoperability purposes. */
|
|
817
|
+
esModule?: CssGeneratorEsModule;
|
|
818
|
+
};
|
|
819
|
+
/** Generator options for css/module modules. */
|
|
820
|
+
export type CssModuleGeneratorOptions = CssAutoGeneratorOptions;
|
|
821
|
+
export type GeneratorOptionsByModuleTypeKnown = {
|
|
822
|
+
/** Generator options for asset modules. */
|
|
823
|
+
asset?: AssetGeneratorOptions;
|
|
824
|
+
/** Generator options for asset/inline modules. */
|
|
825
|
+
"asset/inline"?: AssetInlineGeneratorOptions;
|
|
826
|
+
/** Generator options for asset/resource modules. */
|
|
827
|
+
"asset/resource"?: AssetResourceGeneratorOptions;
|
|
828
|
+
/** Generator options for css modules. */
|
|
829
|
+
css?: CssGeneratorOptions;
|
|
830
|
+
/** Generator options for css/auto modules. */
|
|
831
|
+
"css/auto"?: CssAutoGeneratorOptions;
|
|
832
|
+
/** Generator options for css/module modules. */
|
|
833
|
+
"css/module"?: CssModuleGeneratorOptions;
|
|
834
|
+
};
|
|
835
|
+
export type GeneratorOptionsByModuleTypeUnknown = Record<string, Record<string, any>>;
|
|
836
|
+
/** Options for module.generator */
|
|
837
|
+
export type GeneratorOptionsByModuleType = GeneratorOptionsByModuleTypeKnown | GeneratorOptionsByModuleTypeUnknown;
|
|
838
|
+
type NoParseOptionSingle = string | RegExp | ((request: string) => boolean);
|
|
839
|
+
/** Options for module.noParse */
|
|
840
|
+
export type NoParseOption = NoParseOptionSingle | NoParseOptionSingle[];
|
|
841
|
+
export type ModuleOptions = {
|
|
842
|
+
/** Used to decide how to handle different types of modules in a project. */
|
|
843
|
+
defaultRules?: RuleSetRules;
|
|
844
|
+
/**
|
|
845
|
+
* An array of rules that match the module's requests when it is created.
|
|
846
|
+
* @default []
|
|
847
|
+
* */
|
|
848
|
+
rules?: RuleSetRules;
|
|
849
|
+
/**
|
|
850
|
+
* Configure all parsers' options in one place with module.parser.
|
|
851
|
+
* @default {}
|
|
852
|
+
* */
|
|
853
|
+
parser?: ParserOptionsByModuleType;
|
|
854
|
+
/** Configure all generators' options in one place with module.generator. */
|
|
855
|
+
generator?: GeneratorOptionsByModuleType;
|
|
856
|
+
/** Keep module mechanism of the matched modules as-is, such as module.exports, require, import. */
|
|
857
|
+
noParse?: NoParseOption;
|
|
858
|
+
};
|
|
859
|
+
type AllowTarget = "web" | "webworker" | "es3" | "es5" | "es2015" | "es2016" | "es2017" | "es2018" | "es2019" | "es2020" | "es2021" | "es2022" | "node" | "async-node" | `node${number}` | `async-node${number}` | `node${number}.${number}` | `async-node${number}.${number}` | "electron-main" | `electron${number}-main` | `electron${number}.${number}-main` | "electron-renderer" | `electron${number}-renderer` | `electron${number}.${number}-renderer` | "electron-preload" | `electron${number}-preload` | `electron${number}.${number}-preload` | "nwjs" | `nwjs${number}` | `nwjs${number}.${number}` | "node-webkit" | `node-webkit${number}` | `node-webkit${number}.${number}` | "browserslist" | `browserslist:${string}`;
|
|
860
|
+
/** Used to configure the target environment of Rspack output and the ECMAScript version of Rspack runtime code. */
|
|
861
|
+
export type Target = false | AllowTarget | AllowTarget[];
|
|
551
862
|
/**
|
|
552
863
|
* Specify the default type of externals.
|
|
553
864
|
* `amd`, `umd`, `system` and `jsonp` externals depend on the `output.libraryTarget` being set to the same value e.g. you can only consume amd externals within an amd library.
|
|
@@ -603,6 +914,503 @@ export type ExternalItem = string | RegExp | ExternalItemObjectUnknown | ((data:
|
|
|
603
914
|
* ```
|
|
604
915
|
* */
|
|
605
916
|
export type Externals = ExternalItem | ExternalItem[];
|
|
917
|
+
/** Enable presets of externals for specific targets. */
|
|
918
|
+
export type ExternalsPresets = {
|
|
919
|
+
/** Treat node.js built-in modules like `fs`, `path` or `vm` as external and load them via `require()` when used. */
|
|
920
|
+
node?: boolean;
|
|
921
|
+
/** Treat references to `http(s)://...` and `std:...` as external and load them via import when used. */
|
|
922
|
+
web?: boolean;
|
|
923
|
+
/** Treat references to `http(s)://...` and `std:...` as external and load them via async import() when used */
|
|
924
|
+
webAsync?: boolean;
|
|
925
|
+
/** Treat common electron built-in modules in main and preload context like `electron`, `ipc` or `shell` as external and load them via `require()` when used. */
|
|
926
|
+
electron?: boolean;
|
|
927
|
+
/** Treat electron built-in modules in the main context like `app`, `ipc-main` or `shell` as external and load them via `require()` when used. */
|
|
928
|
+
electronMain?: boolean;
|
|
929
|
+
/** Treat electron built-in modules in the preload context like `web-frame`, `ipc-renderer` or `shell` as external and load them via require() when used. */
|
|
930
|
+
electronPreload?: boolean;
|
|
931
|
+
/** Treat electron built-in modules in the preload context like `web-frame`, `ipc-renderer` or `shell` as external and load them via require() when used. */
|
|
932
|
+
electronRenderer?: boolean;
|
|
933
|
+
/** Treat `NW.js` legacy `nw.gui` module as external and load it via `require()` when used. */
|
|
934
|
+
nwjs?: boolean;
|
|
935
|
+
};
|
|
936
|
+
/**
|
|
937
|
+
* Represents a filter item type for infrastructure logging.
|
|
938
|
+
* Can be a RegExp, a string, or a function that takes a string and returns a boolean.
|
|
939
|
+
*/
|
|
940
|
+
export type FilterItemTypes = RegExp | string | ((value: string) => boolean);
|
|
941
|
+
/**
|
|
942
|
+
* Represents filter types for infrastructure logging.
|
|
943
|
+
* Can be a single FilterItemTypes or an array of FilterItemTypes.
|
|
944
|
+
*/
|
|
945
|
+
export type FilterTypes = FilterItemTypes | FilterItemTypes[];
|
|
946
|
+
/**
|
|
947
|
+
* Options for infrastructure level logging.
|
|
948
|
+
*/
|
|
949
|
+
export type InfrastructureLogging = {
|
|
950
|
+
/**
|
|
951
|
+
* Append lines to the output instead of updating existing output, useful for status messages.
|
|
952
|
+
*/
|
|
953
|
+
appendOnly?: boolean;
|
|
954
|
+
/**
|
|
955
|
+
* Enable colorful output for infrastructure level logging.
|
|
956
|
+
*/
|
|
957
|
+
colors?: boolean;
|
|
958
|
+
/**
|
|
959
|
+
* Customize the console used for infrastructure level logging.
|
|
960
|
+
*/
|
|
961
|
+
console?: Console;
|
|
962
|
+
/**
|
|
963
|
+
* Enable debug information of specified loggers such as plugins or loaders.
|
|
964
|
+
*/
|
|
965
|
+
debug?: boolean | FilterTypes;
|
|
966
|
+
/**
|
|
967
|
+
* Enable infrastructure logging output.
|
|
968
|
+
*/
|
|
969
|
+
level?: "none" | "error" | "warn" | "info" | "log" | "verbose";
|
|
970
|
+
/**
|
|
971
|
+
* Stream used for logging output.
|
|
972
|
+
*/
|
|
973
|
+
stream?: NodeJS.WritableStream;
|
|
974
|
+
};
|
|
975
|
+
/**
|
|
976
|
+
* Configuration used to control the behavior of the Source Map generation.
|
|
977
|
+
*/
|
|
978
|
+
export type DevTool = false | "eval" | "cheap-source-map" | "cheap-module-source-map" | "source-map" | "inline-cheap-source-map" | "inline-cheap-module-source-map" | "inline-source-map" | "inline-nosources-cheap-source-map" | "inline-nosources-cheap-module-source-map" | "inline-nosources-source-map" | "nosources-cheap-source-map" | "nosources-cheap-module-source-map" | "nosources-source-map" | "hidden-nosources-cheap-source-map" | "hidden-nosources-cheap-module-source-map" | "hidden-nosources-source-map" | "hidden-cheap-source-map" | "hidden-cheap-module-source-map" | "hidden-source-map" | "eval-cheap-source-map" | "eval-cheap-module-source-map" | "eval-source-map" | "eval-nosources-cheap-source-map" | "eval-nosources-cheap-module-source-map" | "eval-nosources-source-map";
|
|
979
|
+
/**
|
|
980
|
+
* Options for mocking Node.js globals and modules.
|
|
981
|
+
*/
|
|
982
|
+
export type NodeOptions = {
|
|
983
|
+
/**
|
|
984
|
+
* Controls the behavior of `__dirname`.
|
|
985
|
+
* @description
|
|
986
|
+
* - `true`: The dirname of the input file relative to the context option.
|
|
987
|
+
* - `false`: Regular Node.js `__dirname` behavior. The dirname of the output file when run in a Node.js environment.
|
|
988
|
+
* - `"mock"`: The fixed value '/'.
|
|
989
|
+
* - `"warn-mock"`: Use the fixed value of '/' but show a warning.
|
|
990
|
+
* - `"node-module"`: Replace `__dirname` in CommonJS modules to `fileURLToPath(import.meta.url + "/..")` when `output.module` is enabled.
|
|
991
|
+
* - `"eval-only"`: Equivalent to `false`.
|
|
992
|
+
*/
|
|
993
|
+
__dirname?: boolean | "warn-mock" | "mock" | "eval-only" | "node-module";
|
|
994
|
+
/**
|
|
995
|
+
* Controls the behavior of `__filename`.
|
|
996
|
+
* @description
|
|
997
|
+
* - `true`: The filename of the input file relative to the context option.
|
|
998
|
+
* - `false`: Regular Node.js `__filename` behavior. The filename of the output file when run in a Node.js environment.
|
|
999
|
+
* - `"mock"`: The fixed value '/index.js'.
|
|
1000
|
+
* - `"warn-mock"`: Use the fixed value of '/index.js' but show a warning.
|
|
1001
|
+
* - `"node-module"`: Replace `__filename` in CommonJS modules to `fileURLToPath(import.meta.url)` when `output.module` is enabled.
|
|
1002
|
+
* - `"eval-only"`: Equivalent to `false`.
|
|
1003
|
+
*/
|
|
1004
|
+
__filename?: boolean | "warn-mock" | "mock" | "eval-only" | "node-module";
|
|
1005
|
+
/**
|
|
1006
|
+
* Controls the behavior of `global`.
|
|
1007
|
+
* @description
|
|
1008
|
+
* - `true`: Provide a polyfill.
|
|
1009
|
+
* - `false`: Don't provide a polyfill.
|
|
1010
|
+
* - `"warn"`: Provide a polyfill but show a warning.
|
|
1011
|
+
* @see {@link https://nodejs.org/api/globals.html#globals_global | Node.js documentation} for the exact behavior of this object.
|
|
1012
|
+
* @default "warn"
|
|
1013
|
+
*/
|
|
1014
|
+
global?: boolean | "warn";
|
|
1015
|
+
};
|
|
1016
|
+
/**
|
|
1017
|
+
* Options for mocking Node.js globals and modules.
|
|
1018
|
+
* @description Set to `false` to disable all mocking, or use `NodeOptions` to configure specific behaviors.
|
|
1019
|
+
*/
|
|
1020
|
+
export type Node = false | NodeOptions;
|
|
1021
|
+
export type Loader = Record<string, any>;
|
|
1022
|
+
export type SnapshotOptions = {};
|
|
1023
|
+
/**
|
|
1024
|
+
* Options for caching snapshots and intermediate products during the build process.
|
|
1025
|
+
* @description Controls whether caching is enabled or disabled.
|
|
1026
|
+
* @default true in development mode, false in production mode
|
|
1027
|
+
* @example
|
|
1028
|
+
* // Enable caching
|
|
1029
|
+
* cache: true
|
|
1030
|
+
*
|
|
1031
|
+
* // Disable caching
|
|
1032
|
+
* cache: false
|
|
1033
|
+
*/
|
|
1034
|
+
export type CacheOptions = boolean;
|
|
1035
|
+
type StatsPresets = "normal" | "none" | "verbose" | "errors-only" | "errors-warnings" | "minimal" | "detailed" | "summary";
|
|
1036
|
+
type ModuleFilterItemTypes = RegExp | string | ((name: string, module: any, type: any) => boolean);
|
|
1037
|
+
type ModuleFilterTypes = boolean | ModuleFilterItemTypes | ModuleFilterItemTypes[];
|
|
1038
|
+
/** Options for stats */
|
|
1039
|
+
export type StatsOptions = {
|
|
1040
|
+
/**
|
|
1041
|
+
* Enables or disables the display of all stats.
|
|
1042
|
+
*/
|
|
1043
|
+
all?: boolean;
|
|
1044
|
+
/**
|
|
1045
|
+
* Sets the preset for stats or enables/disables them.
|
|
1046
|
+
*/
|
|
1047
|
+
preset?: boolean | StatsPresets;
|
|
1048
|
+
/**
|
|
1049
|
+
* Enables or disables the display of asset stats.
|
|
1050
|
+
* @default true
|
|
1051
|
+
*/
|
|
1052
|
+
assets?: boolean;
|
|
1053
|
+
/**
|
|
1054
|
+
* Enables or disables the display of chunk stats.
|
|
1055
|
+
* @default true
|
|
1056
|
+
*/
|
|
1057
|
+
chunks?: boolean;
|
|
1058
|
+
/**
|
|
1059
|
+
* Enables or disables the display of module stats.
|
|
1060
|
+
* @default true
|
|
1061
|
+
*/
|
|
1062
|
+
modules?: boolean;
|
|
1063
|
+
/**
|
|
1064
|
+
* Enables or disables the display of entrypoint stats or sets it to 'auto'.
|
|
1065
|
+
* @default false
|
|
1066
|
+
*/
|
|
1067
|
+
entrypoints?: boolean | "auto";
|
|
1068
|
+
/**
|
|
1069
|
+
* Enables or disables the display of chunk group stats.
|
|
1070
|
+
* @default true
|
|
1071
|
+
*/
|
|
1072
|
+
chunkGroups?: boolean;
|
|
1073
|
+
/**
|
|
1074
|
+
* Enables or disables the display of warning stats.
|
|
1075
|
+
* @default true
|
|
1076
|
+
*/
|
|
1077
|
+
warnings?: boolean;
|
|
1078
|
+
/**
|
|
1079
|
+
* Enables or disables the display of warning counts.
|
|
1080
|
+
* @default true
|
|
1081
|
+
*/
|
|
1082
|
+
warningsCount?: boolean;
|
|
1083
|
+
/**
|
|
1084
|
+
* Enables or disables the display of error stats.
|
|
1085
|
+
* @default true
|
|
1086
|
+
*/
|
|
1087
|
+
errors?: boolean;
|
|
1088
|
+
/**
|
|
1089
|
+
* Enables or disables the display of error counts.
|
|
1090
|
+
* @default true
|
|
1091
|
+
*/
|
|
1092
|
+
errorsCount?: boolean;
|
|
1093
|
+
/**
|
|
1094
|
+
* Enables or disables the use of colors in the output.
|
|
1095
|
+
* @default false
|
|
1096
|
+
*/
|
|
1097
|
+
colors?: boolean;
|
|
1098
|
+
/**
|
|
1099
|
+
* Enables or disables the display of the hash.
|
|
1100
|
+
* @default true
|
|
1101
|
+
*/
|
|
1102
|
+
hash?: boolean;
|
|
1103
|
+
/**
|
|
1104
|
+
* Enables or disables the display of the version.
|
|
1105
|
+
* @default true
|
|
1106
|
+
*/
|
|
1107
|
+
version?: boolean;
|
|
1108
|
+
/**
|
|
1109
|
+
* Enables or disables the display of reasons.
|
|
1110
|
+
* @default true
|
|
1111
|
+
*/
|
|
1112
|
+
reasons?: boolean;
|
|
1113
|
+
/**
|
|
1114
|
+
* Enables or disables the display of the public path.
|
|
1115
|
+
* @default true
|
|
1116
|
+
*/
|
|
1117
|
+
publicPath?: boolean;
|
|
1118
|
+
/**
|
|
1119
|
+
* Enables or disables the display of the output path.
|
|
1120
|
+
* @default true
|
|
1121
|
+
*/
|
|
1122
|
+
outputPath?: boolean;
|
|
1123
|
+
/**
|
|
1124
|
+
* Enables or disables the display of chunk module stats.
|
|
1125
|
+
* @default true
|
|
1126
|
+
*/
|
|
1127
|
+
chunkModules?: boolean;
|
|
1128
|
+
/**
|
|
1129
|
+
* Enables or disables the display of chunk relations.
|
|
1130
|
+
* @default false
|
|
1131
|
+
*/
|
|
1132
|
+
chunkRelations?: boolean;
|
|
1133
|
+
/**
|
|
1134
|
+
* Enables or disables the display of module IDs.
|
|
1135
|
+
* @default false
|
|
1136
|
+
*/
|
|
1137
|
+
ids?: boolean;
|
|
1138
|
+
/**
|
|
1139
|
+
* Enables or disables the display of build timings.
|
|
1140
|
+
* @default true
|
|
1141
|
+
*/
|
|
1142
|
+
timings?: boolean;
|
|
1143
|
+
/**
|
|
1144
|
+
* Enables or disables the display of the build date.
|
|
1145
|
+
* @default true
|
|
1146
|
+
*/
|
|
1147
|
+
builtAt?: boolean;
|
|
1148
|
+
/**
|
|
1149
|
+
* Enables or disables the display of module assets.
|
|
1150
|
+
* @default true
|
|
1151
|
+
*/
|
|
1152
|
+
moduleAssets?: boolean;
|
|
1153
|
+
/**
|
|
1154
|
+
* Enables or disables the display of nested modules.
|
|
1155
|
+
* @default true
|
|
1156
|
+
*/
|
|
1157
|
+
nestedModules?: boolean;
|
|
1158
|
+
/**
|
|
1159
|
+
* Enables or disables the display of source code.
|
|
1160
|
+
* @default false
|
|
1161
|
+
*/
|
|
1162
|
+
source?: boolean;
|
|
1163
|
+
/**
|
|
1164
|
+
* Configures the level of logging output.
|
|
1165
|
+
* Can be set to a string value of "none", "error", "warn", "info", "log", "verbose", or a boolean value.
|
|
1166
|
+
*
|
|
1167
|
+
* @description
|
|
1168
|
+
* - `'none'`, false: Logging is disabled.
|
|
1169
|
+
* - `'error'`: Only errors are logged.
|
|
1170
|
+
* - `'warn'`: Errors and warnings are logged.
|
|
1171
|
+
* - `'info'`: Errors, warnings, and info messages are logged.
|
|
1172
|
+
* - `'log'`, true: Errors, warnings, info messages, log messages, groups, and clears are logged. Collapsed groups are initially collapsed.
|
|
1173
|
+
* - `'verbose'`: All log levels except debug and trace are logged. Collapsed groups are initially expanded.
|
|
1174
|
+
*/
|
|
1175
|
+
logging?: "none" | "error" | "warn" | "info" | "log" | "verbose" | boolean;
|
|
1176
|
+
/**
|
|
1177
|
+
* Enables or disables debug logging, or specifies a filter for debug logging.
|
|
1178
|
+
*/
|
|
1179
|
+
loggingDebug?: boolean | FilterTypes;
|
|
1180
|
+
/**
|
|
1181
|
+
* Enables or disables trace logging.
|
|
1182
|
+
* @default true
|
|
1183
|
+
*/
|
|
1184
|
+
loggingTrace?: boolean;
|
|
1185
|
+
/**
|
|
1186
|
+
* Enables or disables the display of runtime modules.
|
|
1187
|
+
* @default true
|
|
1188
|
+
*/
|
|
1189
|
+
runtimeModules?: boolean;
|
|
1190
|
+
/**
|
|
1191
|
+
* Enables or disables the display of children modules.
|
|
1192
|
+
* @default true
|
|
1193
|
+
*/
|
|
1194
|
+
children?: boolean;
|
|
1195
|
+
/**
|
|
1196
|
+
* Enables or disables the display of used exports.
|
|
1197
|
+
* @default false
|
|
1198
|
+
*/
|
|
1199
|
+
usedExports?: boolean;
|
|
1200
|
+
/**
|
|
1201
|
+
* Enables or disables the display of provided exports.
|
|
1202
|
+
* @default false
|
|
1203
|
+
*/
|
|
1204
|
+
providedExports?: boolean;
|
|
1205
|
+
/**
|
|
1206
|
+
* Enables or disables optimization bailout.
|
|
1207
|
+
* @default false
|
|
1208
|
+
*/
|
|
1209
|
+
optimizationBailout?: boolean;
|
|
1210
|
+
/**
|
|
1211
|
+
* Enables or disables grouping of modules by type.
|
|
1212
|
+
*/
|
|
1213
|
+
groupModulesByType?: boolean;
|
|
1214
|
+
/**
|
|
1215
|
+
* Enables or disables grouping of modules by cache status.
|
|
1216
|
+
*/
|
|
1217
|
+
groupModulesByCacheStatus?: boolean;
|
|
1218
|
+
/**
|
|
1219
|
+
* Enables or disables grouping of modules by layer.
|
|
1220
|
+
*/
|
|
1221
|
+
groupModulesByLayer?: boolean;
|
|
1222
|
+
/**
|
|
1223
|
+
* Enables or disables grouping of modules by attributes.
|
|
1224
|
+
*/
|
|
1225
|
+
groupModulesByAttributes?: boolean;
|
|
1226
|
+
/**
|
|
1227
|
+
* Enables or disables grouping of modules by path.
|
|
1228
|
+
*/
|
|
1229
|
+
groupModulesByPath?: boolean;
|
|
1230
|
+
/**
|
|
1231
|
+
* Enables or disables grouping of modules by extension.
|
|
1232
|
+
*/
|
|
1233
|
+
groupModulesByExtension?: boolean;
|
|
1234
|
+
/**
|
|
1235
|
+
* Specifies the space to use for displaying modules.
|
|
1236
|
+
* @default 15
|
|
1237
|
+
*/
|
|
1238
|
+
modulesSpace?: number;
|
|
1239
|
+
/**
|
|
1240
|
+
* Specifies the space to use for displaying chunk modules.
|
|
1241
|
+
* @default 10
|
|
1242
|
+
*/
|
|
1243
|
+
chunkModulesSpace?: number;
|
|
1244
|
+
/**
|
|
1245
|
+
* Specifies the space to use for displaying nested modules.
|
|
1246
|
+
* @default 10
|
|
1247
|
+
*/
|
|
1248
|
+
nestedModulesSpace?: number;
|
|
1249
|
+
/**
|
|
1250
|
+
* Enables or disables the display of related assets.
|
|
1251
|
+
* @default false
|
|
1252
|
+
*/
|
|
1253
|
+
relatedAssets?: boolean;
|
|
1254
|
+
/**
|
|
1255
|
+
* Enables or disables grouping of assets by emit status.
|
|
1256
|
+
*/
|
|
1257
|
+
groupAssetsByEmitStatus?: boolean;
|
|
1258
|
+
/**
|
|
1259
|
+
* Enables or disables grouping of assets by info.
|
|
1260
|
+
*/
|
|
1261
|
+
groupAssetsByInfo?: boolean;
|
|
1262
|
+
/**
|
|
1263
|
+
* Enables or disables grouping of assets by path.
|
|
1264
|
+
*/
|
|
1265
|
+
groupAssetsByPath?: boolean;
|
|
1266
|
+
/**
|
|
1267
|
+
* Enables or disables grouping of assets by extension.
|
|
1268
|
+
*/
|
|
1269
|
+
groupAssetsByExtension?: boolean;
|
|
1270
|
+
/**
|
|
1271
|
+
* Enables or disables grouping of assets by chunk.
|
|
1272
|
+
*/
|
|
1273
|
+
groupAssetsByChunk?: boolean;
|
|
1274
|
+
/**
|
|
1275
|
+
* Specifies the space to use for displaying assets.
|
|
1276
|
+
* @default 15
|
|
1277
|
+
*/
|
|
1278
|
+
assetsSpace?: number;
|
|
1279
|
+
/**
|
|
1280
|
+
* Enables or disables the display of orphan modules.
|
|
1281
|
+
* @default false
|
|
1282
|
+
*/
|
|
1283
|
+
orphanModules?: boolean;
|
|
1284
|
+
/**
|
|
1285
|
+
* Specifies modules to exclude from the bundle.
|
|
1286
|
+
* @default false
|
|
1287
|
+
*/
|
|
1288
|
+
excludeModules?: ModuleFilterTypes;
|
|
1289
|
+
/**
|
|
1290
|
+
* Exclude the matching assets information.
|
|
1291
|
+
* @default false
|
|
1292
|
+
*/
|
|
1293
|
+
excludeAssets?: ModuleFilterTypes;
|
|
1294
|
+
/**
|
|
1295
|
+
* Specifies the sorting order for modules.
|
|
1296
|
+
* @default 'id'
|
|
1297
|
+
*/
|
|
1298
|
+
modulesSort?: string;
|
|
1299
|
+
/**
|
|
1300
|
+
* Specifies the sorting order for chunk modules.
|
|
1301
|
+
*/
|
|
1302
|
+
chunkModulesSort?: string;
|
|
1303
|
+
/**
|
|
1304
|
+
* Specifies the sorting order for nested modules.
|
|
1305
|
+
*/
|
|
1306
|
+
nestedModulesSort?: string;
|
|
1307
|
+
/**
|
|
1308
|
+
* Specifies the sorting order for chunks.
|
|
1309
|
+
* @default 'id'
|
|
1310
|
+
*/
|
|
1311
|
+
chunksSort?: string;
|
|
1312
|
+
/**
|
|
1313
|
+
* Specifies the sorting order for assets.
|
|
1314
|
+
* @default 'id'
|
|
1315
|
+
*/
|
|
1316
|
+
assetsSort?: string;
|
|
1317
|
+
/**
|
|
1318
|
+
* Enables or disables performance optimization.
|
|
1319
|
+
* @default true
|
|
1320
|
+
*/
|
|
1321
|
+
performance?: boolean;
|
|
1322
|
+
/**
|
|
1323
|
+
* Enables or disables environment variables.
|
|
1324
|
+
* @default false
|
|
1325
|
+
*/
|
|
1326
|
+
env?: boolean;
|
|
1327
|
+
/**
|
|
1328
|
+
* Enables or disables auxiliary chunk grouping.
|
|
1329
|
+
* @default true
|
|
1330
|
+
*/
|
|
1331
|
+
chunkGroupAuxiliary?: boolean;
|
|
1332
|
+
/**
|
|
1333
|
+
* Enables or disables child chunk grouping.
|
|
1334
|
+
* @default true
|
|
1335
|
+
*/
|
|
1336
|
+
chunkGroupChildren?: boolean;
|
|
1337
|
+
/**
|
|
1338
|
+
* Specifies the maximum number of assets per chunk group.
|
|
1339
|
+
* @default 5
|
|
1340
|
+
*/
|
|
1341
|
+
chunkGroupMaxAssets?: number;
|
|
1342
|
+
/**
|
|
1343
|
+
* Enables or disables the display of dependent modules.
|
|
1344
|
+
* @default false
|
|
1345
|
+
*/
|
|
1346
|
+
dependentModules?: boolean;
|
|
1347
|
+
/**
|
|
1348
|
+
* Enables or disables the display of chunk origins.
|
|
1349
|
+
* @default true
|
|
1350
|
+
*/
|
|
1351
|
+
chunkOrigins?: boolean;
|
|
1352
|
+
/**
|
|
1353
|
+
* Enables or disables the display of runtime information.
|
|
1354
|
+
*/
|
|
1355
|
+
runtime?: boolean;
|
|
1356
|
+
/**
|
|
1357
|
+
* Enables or disables the display of depth information.
|
|
1358
|
+
* @default false
|
|
1359
|
+
*/
|
|
1360
|
+
depth?: boolean;
|
|
1361
|
+
/**
|
|
1362
|
+
* Specifies the space to use for displaying reasons.
|
|
1363
|
+
* @default 100
|
|
1364
|
+
*/
|
|
1365
|
+
reasonsSpace?: number;
|
|
1366
|
+
/**
|
|
1367
|
+
* Enables or disables grouping of reasons by origin.
|
|
1368
|
+
*/
|
|
1369
|
+
groupReasonsByOrigin?: boolean;
|
|
1370
|
+
/**
|
|
1371
|
+
* Enables or disables the display of error details.
|
|
1372
|
+
* @default false
|
|
1373
|
+
*/
|
|
1374
|
+
errorDetails?: boolean;
|
|
1375
|
+
/**
|
|
1376
|
+
* Enables or disables the display of error stack traces.
|
|
1377
|
+
* @default true
|
|
1378
|
+
*/
|
|
1379
|
+
errorStack?: boolean;
|
|
1380
|
+
/**
|
|
1381
|
+
* Enables or disables the display of module trace information.
|
|
1382
|
+
* @default true
|
|
1383
|
+
*/
|
|
1384
|
+
moduleTrace?: boolean;
|
|
1385
|
+
/**
|
|
1386
|
+
* Enables or disables the display of cached modules.
|
|
1387
|
+
* @default true
|
|
1388
|
+
*/
|
|
1389
|
+
cachedModules?: boolean;
|
|
1390
|
+
/**
|
|
1391
|
+
* Enables or disables the display of cached assets.
|
|
1392
|
+
* @default true
|
|
1393
|
+
*/
|
|
1394
|
+
cachedAssets?: boolean;
|
|
1395
|
+
/**
|
|
1396
|
+
* Enables or disables the display of cached information.
|
|
1397
|
+
*/
|
|
1398
|
+
cached?: boolean;
|
|
1399
|
+
/**
|
|
1400
|
+
* Specifies the space to use for displaying errors.
|
|
1401
|
+
* @default 5
|
|
1402
|
+
*/
|
|
1403
|
+
errorsSpace?: number;
|
|
1404
|
+
/**
|
|
1405
|
+
* Specifies the space to use for displaying warnings.
|
|
1406
|
+
* @default 5
|
|
1407
|
+
*/
|
|
1408
|
+
warningsSpace?: number;
|
|
1409
|
+
};
|
|
1410
|
+
/**
|
|
1411
|
+
* Represents the value for stats configuration.
|
|
1412
|
+
*/
|
|
1413
|
+
export type StatsValue = boolean | StatsOptions | StatsPresets;
|
|
606
1414
|
export interface RspackPluginInstance {
|
|
607
1415
|
apply: (compiler: Compiler) => void;
|
|
608
1416
|
[k: string]: any;
|