@rspack/core 1.0.13 → 1.1.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/compiled/@swc/types/index.d.ts +1962 -0
- package/compiled/@swc/types/index.js +19 -0
- package/compiled/@swc/types/license +201 -0
- package/compiled/@swc/types/package.json +1 -0
- package/dist/Compilation.d.ts +6 -17
- package/dist/Compiler.d.ts +0 -1
- package/dist/FileSystem.d.ts +7 -3
- package/dist/Module.d.ts +5 -3
- package/dist/NormalModule.d.ts +2 -7
- package/dist/RuntimeGlobals.d.ts +1 -1
- package/dist/builtin-loader/swc/types.d.ts +9 -435
- 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 +16 -10
- 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 → LightningCssMinimizerRspackPlugin.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/RemoveDuplicateModulesPlugin.d.ts +10 -0
- 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 +10 -10
- package/dist/builtin-plugin/SourceMapDevToolPlugin.d.ts +2 -2
- package/dist/builtin-plugin/SplitChunksPlugin.d.ts +1 -1
- 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/index.d.ts +4 -2
- 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/adapter.d.ts +1 -1
- package/dist/config/adapterRuleUse.d.ts +1 -2
- package/dist/config/index.d.ts +1 -0
- package/dist/config/normalization.d.ts +2 -1
- package/dist/config/types.d.ts +889 -3
- package/dist/config/zod.d.ts +1010 -2231
- package/dist/container/ModuleFederationRuntimePlugin.d.ts +2 -2
- package/dist/exports.d.ts +4 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +443 -4852
- 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/ArrayQueue.d.ts +1 -9
- package/dist/util/asyncLib.d.ts +54 -0
- 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 +6 -6
- package/dist/builtin-loader/swc/react.d.ts +0 -15
package/dist/config/types.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { JsAssetInfo, RawFuncUseCtx } from "@rspack/binding";
|
|
2
|
-
import type
|
|
2
|
+
import type * as webpackDevServer from "webpack-dev-server";
|
|
3
|
+
import type { Compilation, PathData } from "../Compilation";
|
|
3
4
|
import type { Compiler } from "../Compiler";
|
|
4
5
|
import type { Module } from "../Module";
|
|
5
6
|
import type { Chunk } from "../exports";
|
|
@@ -385,12 +386,12 @@ export type Output = {
|
|
|
385
386
|
hashDigest?: HashDigest;
|
|
386
387
|
/**
|
|
387
388
|
* The prefix length of the hash digest to use.
|
|
388
|
-
* @default
|
|
389
|
+
* @default 16
|
|
389
390
|
* */
|
|
390
391
|
hashDigestLength?: HashDigestLength;
|
|
391
392
|
/**
|
|
392
393
|
* The hashing algorithm to use.
|
|
393
|
-
* @default '
|
|
394
|
+
* @default 'xxhash64'
|
|
394
395
|
* */
|
|
395
396
|
hashFunction?: HashFunction;
|
|
396
397
|
/** An optional salt to update the hash. */
|
|
@@ -435,6 +436,10 @@ export type Output = {
|
|
|
435
436
|
charset?: boolean;
|
|
436
437
|
/** Tell Rspack what kind of ES-features may be used in the generated runtime-code. */
|
|
437
438
|
environment?: Environment;
|
|
439
|
+
/**
|
|
440
|
+
* Check if to be emitted file already exists and have the same content before writing to output filesystem.
|
|
441
|
+
*/
|
|
442
|
+
compareBeforeEmit?: boolean;
|
|
438
443
|
};
|
|
439
444
|
/**
|
|
440
445
|
* Path alias
|
|
@@ -712,6 +717,10 @@ export type JavascriptParserOptions = {
|
|
|
712
717
|
* @default false
|
|
713
718
|
* */
|
|
714
719
|
wrappedContextCritical?: boolean;
|
|
720
|
+
/**
|
|
721
|
+
* Set the inner regular expression for partial dynamic dependencies
|
|
722
|
+
* */
|
|
723
|
+
wrappedContextRegExp?: RegExp;
|
|
715
724
|
/**
|
|
716
725
|
* Warn or error for using non-existent exports and conflicting re-exports.
|
|
717
726
|
* @default 'auto'
|
|
@@ -856,6 +865,9 @@ export type ModuleOptions = {
|
|
|
856
865
|
/** Keep module mechanism of the matched modules as-is, such as module.exports, require, import. */
|
|
857
866
|
noParse?: NoParseOption;
|
|
858
867
|
};
|
|
868
|
+
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}`;
|
|
869
|
+
/** Used to configure the target environment of Rspack output and the ECMAScript version of Rspack runtime code. */
|
|
870
|
+
export type Target = false | AllowTarget | AllowTarget[];
|
|
859
871
|
/**
|
|
860
872
|
* Specify the default type of externals.
|
|
861
873
|
* `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.
|
|
@@ -911,6 +923,503 @@ export type ExternalItem = string | RegExp | ExternalItemObjectUnknown | ((data:
|
|
|
911
923
|
* ```
|
|
912
924
|
* */
|
|
913
925
|
export type Externals = ExternalItem | ExternalItem[];
|
|
926
|
+
/** Enable presets of externals for specific targets. */
|
|
927
|
+
export type ExternalsPresets = {
|
|
928
|
+
/** Treat node.js built-in modules like `fs`, `path` or `vm` as external and load them via `require()` when used. */
|
|
929
|
+
node?: boolean;
|
|
930
|
+
/** Treat references to `http(s)://...` and `std:...` as external and load them via import when used. */
|
|
931
|
+
web?: boolean;
|
|
932
|
+
/** Treat references to `http(s)://...` and `std:...` as external and load them via async import() when used */
|
|
933
|
+
webAsync?: boolean;
|
|
934
|
+
/** 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. */
|
|
935
|
+
electron?: boolean;
|
|
936
|
+
/** Treat electron built-in modules in the main context like `app`, `ipc-main` or `shell` as external and load them via `require()` when used. */
|
|
937
|
+
electronMain?: boolean;
|
|
938
|
+
/** 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. */
|
|
939
|
+
electronPreload?: boolean;
|
|
940
|
+
/** 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. */
|
|
941
|
+
electronRenderer?: boolean;
|
|
942
|
+
/** Treat `NW.js` legacy `nw.gui` module as external and load it via `require()` when used. */
|
|
943
|
+
nwjs?: boolean;
|
|
944
|
+
};
|
|
945
|
+
/**
|
|
946
|
+
* Represents a filter item type for infrastructure logging.
|
|
947
|
+
* Can be a RegExp, a string, or a function that takes a string and returns a boolean.
|
|
948
|
+
*/
|
|
949
|
+
export type FilterItemTypes = RegExp | string | ((value: string) => boolean);
|
|
950
|
+
/**
|
|
951
|
+
* Represents filter types for infrastructure logging.
|
|
952
|
+
* Can be a single FilterItemTypes or an array of FilterItemTypes.
|
|
953
|
+
*/
|
|
954
|
+
export type FilterTypes = FilterItemTypes | FilterItemTypes[];
|
|
955
|
+
/**
|
|
956
|
+
* Options for infrastructure level logging.
|
|
957
|
+
*/
|
|
958
|
+
export type InfrastructureLogging = {
|
|
959
|
+
/**
|
|
960
|
+
* Append lines to the output instead of updating existing output, useful for status messages.
|
|
961
|
+
*/
|
|
962
|
+
appendOnly?: boolean;
|
|
963
|
+
/**
|
|
964
|
+
* Enable colorful output for infrastructure level logging.
|
|
965
|
+
*/
|
|
966
|
+
colors?: boolean;
|
|
967
|
+
/**
|
|
968
|
+
* Customize the console used for infrastructure level logging.
|
|
969
|
+
*/
|
|
970
|
+
console?: Console;
|
|
971
|
+
/**
|
|
972
|
+
* Enable debug information of specified loggers such as plugins or loaders.
|
|
973
|
+
*/
|
|
974
|
+
debug?: boolean | FilterTypes;
|
|
975
|
+
/**
|
|
976
|
+
* Enable infrastructure logging output.
|
|
977
|
+
*/
|
|
978
|
+
level?: "none" | "error" | "warn" | "info" | "log" | "verbose";
|
|
979
|
+
/**
|
|
980
|
+
* Stream used for logging output.
|
|
981
|
+
*/
|
|
982
|
+
stream?: NodeJS.WritableStream;
|
|
983
|
+
};
|
|
984
|
+
/**
|
|
985
|
+
* Configuration used to control the behavior of the Source Map generation.
|
|
986
|
+
*/
|
|
987
|
+
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";
|
|
988
|
+
/**
|
|
989
|
+
* Options for mocking Node.js globals and modules.
|
|
990
|
+
*/
|
|
991
|
+
export type NodeOptions = {
|
|
992
|
+
/**
|
|
993
|
+
* Controls the behavior of `__dirname`.
|
|
994
|
+
* @description
|
|
995
|
+
* - `true`: The dirname of the input file relative to the context option.
|
|
996
|
+
* - `false`: Regular Node.js `__dirname` behavior. The dirname of the output file when run in a Node.js environment.
|
|
997
|
+
* - `"mock"`: The fixed value '/'.
|
|
998
|
+
* - `"warn-mock"`: Use the fixed value of '/' but show a warning.
|
|
999
|
+
* - `"node-module"`: Replace `__dirname` in CommonJS modules to `fileURLToPath(import.meta.url + "/..")` when `output.module` is enabled.
|
|
1000
|
+
* - `"eval-only"`: Equivalent to `false`.
|
|
1001
|
+
*/
|
|
1002
|
+
__dirname?: boolean | "warn-mock" | "mock" | "eval-only" | "node-module";
|
|
1003
|
+
/**
|
|
1004
|
+
* Controls the behavior of `__filename`.
|
|
1005
|
+
* @description
|
|
1006
|
+
* - `true`: The filename of the input file relative to the context option.
|
|
1007
|
+
* - `false`: Regular Node.js `__filename` behavior. The filename of the output file when run in a Node.js environment.
|
|
1008
|
+
* - `"mock"`: The fixed value '/index.js'.
|
|
1009
|
+
* - `"warn-mock"`: Use the fixed value of '/index.js' but show a warning.
|
|
1010
|
+
* - `"node-module"`: Replace `__filename` in CommonJS modules to `fileURLToPath(import.meta.url)` when `output.module` is enabled.
|
|
1011
|
+
* - `"eval-only"`: Equivalent to `false`.
|
|
1012
|
+
*/
|
|
1013
|
+
__filename?: boolean | "warn-mock" | "mock" | "eval-only" | "node-module";
|
|
1014
|
+
/**
|
|
1015
|
+
* Controls the behavior of `global`.
|
|
1016
|
+
* @description
|
|
1017
|
+
* - `true`: Provide a polyfill.
|
|
1018
|
+
* - `false`: Don't provide a polyfill.
|
|
1019
|
+
* - `"warn"`: Provide a polyfill but show a warning.
|
|
1020
|
+
* @see {@link https://nodejs.org/api/globals.html#globals_global | Node.js documentation} for the exact behavior of this object.
|
|
1021
|
+
* @default "warn"
|
|
1022
|
+
*/
|
|
1023
|
+
global?: boolean | "warn";
|
|
1024
|
+
};
|
|
1025
|
+
/**
|
|
1026
|
+
* Options for mocking Node.js globals and modules.
|
|
1027
|
+
* @description Set to `false` to disable all mocking, or use `NodeOptions` to configure specific behaviors.
|
|
1028
|
+
*/
|
|
1029
|
+
export type Node = false | NodeOptions;
|
|
1030
|
+
export type Loader = Record<string, any>;
|
|
1031
|
+
export type SnapshotOptions = {};
|
|
1032
|
+
/**
|
|
1033
|
+
* Options for caching snapshots and intermediate products during the build process.
|
|
1034
|
+
* @description Controls whether caching is enabled or disabled.
|
|
1035
|
+
* @default true in development mode, false in production mode
|
|
1036
|
+
* @example
|
|
1037
|
+
* // Enable caching
|
|
1038
|
+
* cache: true
|
|
1039
|
+
*
|
|
1040
|
+
* // Disable caching
|
|
1041
|
+
* cache: false
|
|
1042
|
+
*/
|
|
1043
|
+
export type CacheOptions = boolean;
|
|
1044
|
+
type StatsPresets = "normal" | "none" | "verbose" | "errors-only" | "errors-warnings" | "minimal" | "detailed" | "summary";
|
|
1045
|
+
type ModuleFilterItemTypes = RegExp | string | ((name: string, module: any, type: any) => boolean);
|
|
1046
|
+
type ModuleFilterTypes = boolean | ModuleFilterItemTypes | ModuleFilterItemTypes[];
|
|
1047
|
+
/** Options for stats */
|
|
1048
|
+
export type StatsOptions = {
|
|
1049
|
+
/**
|
|
1050
|
+
* Enables or disables the display of all stats.
|
|
1051
|
+
*/
|
|
1052
|
+
all?: boolean;
|
|
1053
|
+
/**
|
|
1054
|
+
* Sets the preset for stats or enables/disables them.
|
|
1055
|
+
*/
|
|
1056
|
+
preset?: boolean | StatsPresets;
|
|
1057
|
+
/**
|
|
1058
|
+
* Enables or disables the display of asset stats.
|
|
1059
|
+
* @default true
|
|
1060
|
+
*/
|
|
1061
|
+
assets?: boolean;
|
|
1062
|
+
/**
|
|
1063
|
+
* Enables or disables the display of chunk stats.
|
|
1064
|
+
* @default true
|
|
1065
|
+
*/
|
|
1066
|
+
chunks?: boolean;
|
|
1067
|
+
/**
|
|
1068
|
+
* Enables or disables the display of module stats.
|
|
1069
|
+
* @default true
|
|
1070
|
+
*/
|
|
1071
|
+
modules?: boolean;
|
|
1072
|
+
/**
|
|
1073
|
+
* Enables or disables the display of entrypoint stats or sets it to 'auto'.
|
|
1074
|
+
* @default false
|
|
1075
|
+
*/
|
|
1076
|
+
entrypoints?: boolean | "auto";
|
|
1077
|
+
/**
|
|
1078
|
+
* Enables or disables the display of chunk group stats.
|
|
1079
|
+
* @default true
|
|
1080
|
+
*/
|
|
1081
|
+
chunkGroups?: boolean;
|
|
1082
|
+
/**
|
|
1083
|
+
* Enables or disables the display of warning stats.
|
|
1084
|
+
* @default true
|
|
1085
|
+
*/
|
|
1086
|
+
warnings?: boolean;
|
|
1087
|
+
/**
|
|
1088
|
+
* Enables or disables the display of warning counts.
|
|
1089
|
+
* @default true
|
|
1090
|
+
*/
|
|
1091
|
+
warningsCount?: boolean;
|
|
1092
|
+
/**
|
|
1093
|
+
* Enables or disables the display of error stats.
|
|
1094
|
+
* @default true
|
|
1095
|
+
*/
|
|
1096
|
+
errors?: boolean;
|
|
1097
|
+
/**
|
|
1098
|
+
* Enables or disables the display of error counts.
|
|
1099
|
+
* @default true
|
|
1100
|
+
*/
|
|
1101
|
+
errorsCount?: boolean;
|
|
1102
|
+
/**
|
|
1103
|
+
* Enables or disables the use of colors in the output.
|
|
1104
|
+
* @default false
|
|
1105
|
+
*/
|
|
1106
|
+
colors?: boolean;
|
|
1107
|
+
/**
|
|
1108
|
+
* Enables or disables the display of the hash.
|
|
1109
|
+
* @default true
|
|
1110
|
+
*/
|
|
1111
|
+
hash?: boolean;
|
|
1112
|
+
/**
|
|
1113
|
+
* Enables or disables the display of the version.
|
|
1114
|
+
* @default true
|
|
1115
|
+
*/
|
|
1116
|
+
version?: boolean;
|
|
1117
|
+
/**
|
|
1118
|
+
* Enables or disables the display of reasons.
|
|
1119
|
+
* @default true
|
|
1120
|
+
*/
|
|
1121
|
+
reasons?: boolean;
|
|
1122
|
+
/**
|
|
1123
|
+
* Enables or disables the display of the public path.
|
|
1124
|
+
* @default true
|
|
1125
|
+
*/
|
|
1126
|
+
publicPath?: boolean;
|
|
1127
|
+
/**
|
|
1128
|
+
* Enables or disables the display of the output path.
|
|
1129
|
+
* @default true
|
|
1130
|
+
*/
|
|
1131
|
+
outputPath?: boolean;
|
|
1132
|
+
/**
|
|
1133
|
+
* Enables or disables the display of chunk module stats.
|
|
1134
|
+
* @default true
|
|
1135
|
+
*/
|
|
1136
|
+
chunkModules?: boolean;
|
|
1137
|
+
/**
|
|
1138
|
+
* Enables or disables the display of chunk relations.
|
|
1139
|
+
* @default false
|
|
1140
|
+
*/
|
|
1141
|
+
chunkRelations?: boolean;
|
|
1142
|
+
/**
|
|
1143
|
+
* Enables or disables the display of module IDs.
|
|
1144
|
+
* @default false
|
|
1145
|
+
*/
|
|
1146
|
+
ids?: boolean;
|
|
1147
|
+
/**
|
|
1148
|
+
* Enables or disables the display of build timings.
|
|
1149
|
+
* @default true
|
|
1150
|
+
*/
|
|
1151
|
+
timings?: boolean;
|
|
1152
|
+
/**
|
|
1153
|
+
* Enables or disables the display of the build date.
|
|
1154
|
+
* @default true
|
|
1155
|
+
*/
|
|
1156
|
+
builtAt?: boolean;
|
|
1157
|
+
/**
|
|
1158
|
+
* Enables or disables the display of module assets.
|
|
1159
|
+
* @default true
|
|
1160
|
+
*/
|
|
1161
|
+
moduleAssets?: boolean;
|
|
1162
|
+
/**
|
|
1163
|
+
* Enables or disables the display of nested modules.
|
|
1164
|
+
* @default true
|
|
1165
|
+
*/
|
|
1166
|
+
nestedModules?: boolean;
|
|
1167
|
+
/**
|
|
1168
|
+
* Enables or disables the display of source code.
|
|
1169
|
+
* @default false
|
|
1170
|
+
*/
|
|
1171
|
+
source?: boolean;
|
|
1172
|
+
/**
|
|
1173
|
+
* Configures the level of logging output.
|
|
1174
|
+
* Can be set to a string value of "none", "error", "warn", "info", "log", "verbose", or a boolean value.
|
|
1175
|
+
*
|
|
1176
|
+
* @description
|
|
1177
|
+
* - `'none'`, false: Logging is disabled.
|
|
1178
|
+
* - `'error'`: Only errors are logged.
|
|
1179
|
+
* - `'warn'`: Errors and warnings are logged.
|
|
1180
|
+
* - `'info'`: Errors, warnings, and info messages are logged.
|
|
1181
|
+
* - `'log'`, true: Errors, warnings, info messages, log messages, groups, and clears are logged. Collapsed groups are initially collapsed.
|
|
1182
|
+
* - `'verbose'`: All log levels except debug and trace are logged. Collapsed groups are initially expanded.
|
|
1183
|
+
*/
|
|
1184
|
+
logging?: "none" | "error" | "warn" | "info" | "log" | "verbose" | boolean;
|
|
1185
|
+
/**
|
|
1186
|
+
* Enables or disables debug logging, or specifies a filter for debug logging.
|
|
1187
|
+
*/
|
|
1188
|
+
loggingDebug?: boolean | FilterTypes;
|
|
1189
|
+
/**
|
|
1190
|
+
* Enables or disables trace logging.
|
|
1191
|
+
* @default true
|
|
1192
|
+
*/
|
|
1193
|
+
loggingTrace?: boolean;
|
|
1194
|
+
/**
|
|
1195
|
+
* Enables or disables the display of runtime modules.
|
|
1196
|
+
* @default true
|
|
1197
|
+
*/
|
|
1198
|
+
runtimeModules?: boolean;
|
|
1199
|
+
/**
|
|
1200
|
+
* Enables or disables the display of children modules.
|
|
1201
|
+
* @default true
|
|
1202
|
+
*/
|
|
1203
|
+
children?: boolean;
|
|
1204
|
+
/**
|
|
1205
|
+
* Enables or disables the display of used exports.
|
|
1206
|
+
* @default false
|
|
1207
|
+
*/
|
|
1208
|
+
usedExports?: boolean;
|
|
1209
|
+
/**
|
|
1210
|
+
* Enables or disables the display of provided exports.
|
|
1211
|
+
* @default false
|
|
1212
|
+
*/
|
|
1213
|
+
providedExports?: boolean;
|
|
1214
|
+
/**
|
|
1215
|
+
* Enables or disables optimization bailout.
|
|
1216
|
+
* @default false
|
|
1217
|
+
*/
|
|
1218
|
+
optimizationBailout?: boolean;
|
|
1219
|
+
/**
|
|
1220
|
+
* Enables or disables grouping of modules by type.
|
|
1221
|
+
*/
|
|
1222
|
+
groupModulesByType?: boolean;
|
|
1223
|
+
/**
|
|
1224
|
+
* Enables or disables grouping of modules by cache status.
|
|
1225
|
+
*/
|
|
1226
|
+
groupModulesByCacheStatus?: boolean;
|
|
1227
|
+
/**
|
|
1228
|
+
* Enables or disables grouping of modules by layer.
|
|
1229
|
+
*/
|
|
1230
|
+
groupModulesByLayer?: boolean;
|
|
1231
|
+
/**
|
|
1232
|
+
* Enables or disables grouping of modules by attributes.
|
|
1233
|
+
*/
|
|
1234
|
+
groupModulesByAttributes?: boolean;
|
|
1235
|
+
/**
|
|
1236
|
+
* Enables or disables grouping of modules by path.
|
|
1237
|
+
*/
|
|
1238
|
+
groupModulesByPath?: boolean;
|
|
1239
|
+
/**
|
|
1240
|
+
* Enables or disables grouping of modules by extension.
|
|
1241
|
+
*/
|
|
1242
|
+
groupModulesByExtension?: boolean;
|
|
1243
|
+
/**
|
|
1244
|
+
* Specifies the space to use for displaying modules.
|
|
1245
|
+
* @default 15
|
|
1246
|
+
*/
|
|
1247
|
+
modulesSpace?: number;
|
|
1248
|
+
/**
|
|
1249
|
+
* Specifies the space to use for displaying chunk modules.
|
|
1250
|
+
* @default 10
|
|
1251
|
+
*/
|
|
1252
|
+
chunkModulesSpace?: number;
|
|
1253
|
+
/**
|
|
1254
|
+
* Specifies the space to use for displaying nested modules.
|
|
1255
|
+
* @default 10
|
|
1256
|
+
*/
|
|
1257
|
+
nestedModulesSpace?: number;
|
|
1258
|
+
/**
|
|
1259
|
+
* Enables or disables the display of related assets.
|
|
1260
|
+
* @default false
|
|
1261
|
+
*/
|
|
1262
|
+
relatedAssets?: boolean;
|
|
1263
|
+
/**
|
|
1264
|
+
* Enables or disables grouping of assets by emit status.
|
|
1265
|
+
*/
|
|
1266
|
+
groupAssetsByEmitStatus?: boolean;
|
|
1267
|
+
/**
|
|
1268
|
+
* Enables or disables grouping of assets by info.
|
|
1269
|
+
*/
|
|
1270
|
+
groupAssetsByInfo?: boolean;
|
|
1271
|
+
/**
|
|
1272
|
+
* Enables or disables grouping of assets by path.
|
|
1273
|
+
*/
|
|
1274
|
+
groupAssetsByPath?: boolean;
|
|
1275
|
+
/**
|
|
1276
|
+
* Enables or disables grouping of assets by extension.
|
|
1277
|
+
*/
|
|
1278
|
+
groupAssetsByExtension?: boolean;
|
|
1279
|
+
/**
|
|
1280
|
+
* Enables or disables grouping of assets by chunk.
|
|
1281
|
+
*/
|
|
1282
|
+
groupAssetsByChunk?: boolean;
|
|
1283
|
+
/**
|
|
1284
|
+
* Specifies the space to use for displaying assets.
|
|
1285
|
+
* @default 15
|
|
1286
|
+
*/
|
|
1287
|
+
assetsSpace?: number;
|
|
1288
|
+
/**
|
|
1289
|
+
* Enables or disables the display of orphan modules.
|
|
1290
|
+
* @default false
|
|
1291
|
+
*/
|
|
1292
|
+
orphanModules?: boolean;
|
|
1293
|
+
/**
|
|
1294
|
+
* Specifies modules to exclude from the bundle.
|
|
1295
|
+
* @default false
|
|
1296
|
+
*/
|
|
1297
|
+
excludeModules?: ModuleFilterTypes;
|
|
1298
|
+
/**
|
|
1299
|
+
* Exclude the matching assets information.
|
|
1300
|
+
* @default false
|
|
1301
|
+
*/
|
|
1302
|
+
excludeAssets?: ModuleFilterTypes;
|
|
1303
|
+
/**
|
|
1304
|
+
* Specifies the sorting order for modules.
|
|
1305
|
+
* @default 'id'
|
|
1306
|
+
*/
|
|
1307
|
+
modulesSort?: string;
|
|
1308
|
+
/**
|
|
1309
|
+
* Specifies the sorting order for chunk modules.
|
|
1310
|
+
*/
|
|
1311
|
+
chunkModulesSort?: string;
|
|
1312
|
+
/**
|
|
1313
|
+
* Specifies the sorting order for nested modules.
|
|
1314
|
+
*/
|
|
1315
|
+
nestedModulesSort?: string;
|
|
1316
|
+
/**
|
|
1317
|
+
* Specifies the sorting order for chunks.
|
|
1318
|
+
* @default 'id'
|
|
1319
|
+
*/
|
|
1320
|
+
chunksSort?: string;
|
|
1321
|
+
/**
|
|
1322
|
+
* Specifies the sorting order for assets.
|
|
1323
|
+
* @default 'id'
|
|
1324
|
+
*/
|
|
1325
|
+
assetsSort?: string;
|
|
1326
|
+
/**
|
|
1327
|
+
* Enables or disables performance optimization.
|
|
1328
|
+
* @default true
|
|
1329
|
+
*/
|
|
1330
|
+
performance?: boolean;
|
|
1331
|
+
/**
|
|
1332
|
+
* Enables or disables environment variables.
|
|
1333
|
+
* @default false
|
|
1334
|
+
*/
|
|
1335
|
+
env?: boolean;
|
|
1336
|
+
/**
|
|
1337
|
+
* Enables or disables auxiliary chunk grouping.
|
|
1338
|
+
* @default true
|
|
1339
|
+
*/
|
|
1340
|
+
chunkGroupAuxiliary?: boolean;
|
|
1341
|
+
/**
|
|
1342
|
+
* Enables or disables child chunk grouping.
|
|
1343
|
+
* @default true
|
|
1344
|
+
*/
|
|
1345
|
+
chunkGroupChildren?: boolean;
|
|
1346
|
+
/**
|
|
1347
|
+
* Specifies the maximum number of assets per chunk group.
|
|
1348
|
+
* @default 5
|
|
1349
|
+
*/
|
|
1350
|
+
chunkGroupMaxAssets?: number;
|
|
1351
|
+
/**
|
|
1352
|
+
* Enables or disables the display of dependent modules.
|
|
1353
|
+
* @default false
|
|
1354
|
+
*/
|
|
1355
|
+
dependentModules?: boolean;
|
|
1356
|
+
/**
|
|
1357
|
+
* Enables or disables the display of chunk origins.
|
|
1358
|
+
* @default true
|
|
1359
|
+
*/
|
|
1360
|
+
chunkOrigins?: boolean;
|
|
1361
|
+
/**
|
|
1362
|
+
* Enables or disables the display of runtime information.
|
|
1363
|
+
*/
|
|
1364
|
+
runtime?: boolean;
|
|
1365
|
+
/**
|
|
1366
|
+
* Enables or disables the display of depth information.
|
|
1367
|
+
* @default false
|
|
1368
|
+
*/
|
|
1369
|
+
depth?: boolean;
|
|
1370
|
+
/**
|
|
1371
|
+
* Specifies the space to use for displaying reasons.
|
|
1372
|
+
* @default 100
|
|
1373
|
+
*/
|
|
1374
|
+
reasonsSpace?: number;
|
|
1375
|
+
/**
|
|
1376
|
+
* Enables or disables grouping of reasons by origin.
|
|
1377
|
+
*/
|
|
1378
|
+
groupReasonsByOrigin?: boolean;
|
|
1379
|
+
/**
|
|
1380
|
+
* Enables or disables the display of error details.
|
|
1381
|
+
* @default false
|
|
1382
|
+
*/
|
|
1383
|
+
errorDetails?: boolean;
|
|
1384
|
+
/**
|
|
1385
|
+
* Enables or disables the display of error stack traces.
|
|
1386
|
+
* @default true
|
|
1387
|
+
*/
|
|
1388
|
+
errorStack?: boolean;
|
|
1389
|
+
/**
|
|
1390
|
+
* Enables or disables the display of module trace information.
|
|
1391
|
+
* @default true
|
|
1392
|
+
*/
|
|
1393
|
+
moduleTrace?: boolean;
|
|
1394
|
+
/**
|
|
1395
|
+
* Enables or disables the display of cached modules.
|
|
1396
|
+
* @default true
|
|
1397
|
+
*/
|
|
1398
|
+
cachedModules?: boolean;
|
|
1399
|
+
/**
|
|
1400
|
+
* Enables or disables the display of cached assets.
|
|
1401
|
+
* @default true
|
|
1402
|
+
*/
|
|
1403
|
+
cachedAssets?: boolean;
|
|
1404
|
+
/**
|
|
1405
|
+
* Enables or disables the display of cached information.
|
|
1406
|
+
*/
|
|
1407
|
+
cached?: boolean;
|
|
1408
|
+
/**
|
|
1409
|
+
* Specifies the space to use for displaying errors.
|
|
1410
|
+
* @default 5
|
|
1411
|
+
*/
|
|
1412
|
+
errorsSpace?: number;
|
|
1413
|
+
/**
|
|
1414
|
+
* Specifies the space to use for displaying warnings.
|
|
1415
|
+
* @default 5
|
|
1416
|
+
*/
|
|
1417
|
+
warningsSpace?: number;
|
|
1418
|
+
};
|
|
1419
|
+
/**
|
|
1420
|
+
* Represents the value for stats configuration.
|
|
1421
|
+
*/
|
|
1422
|
+
export type StatsValue = boolean | StatsOptions | StatsPresets;
|
|
914
1423
|
export interface RspackPluginInstance {
|
|
915
1424
|
apply: (compiler: Compiler) => void;
|
|
916
1425
|
[k: string]: any;
|
|
@@ -1143,4 +1652,381 @@ export type Optimization = {
|
|
|
1143
1652
|
* */
|
|
1144
1653
|
emitOnErrors?: boolean;
|
|
1145
1654
|
};
|
|
1655
|
+
/**
|
|
1656
|
+
* Options for future Rspack features.
|
|
1657
|
+
*/
|
|
1658
|
+
export type RspackFutureOptions = {
|
|
1659
|
+
/**
|
|
1660
|
+
* Information about the bundler.
|
|
1661
|
+
*/
|
|
1662
|
+
bundlerInfo?: {
|
|
1663
|
+
/**
|
|
1664
|
+
* Version of the bundler.
|
|
1665
|
+
*/
|
|
1666
|
+
version?: string;
|
|
1667
|
+
/**
|
|
1668
|
+
* Name of the bundler.
|
|
1669
|
+
*/
|
|
1670
|
+
bundler?: string;
|
|
1671
|
+
/**
|
|
1672
|
+
* Force specific features.
|
|
1673
|
+
*/
|
|
1674
|
+
force?: boolean | ("version" | "uniqueId")[];
|
|
1675
|
+
};
|
|
1676
|
+
};
|
|
1677
|
+
/**
|
|
1678
|
+
* Options for server listening.
|
|
1679
|
+
*/
|
|
1680
|
+
type ListenOptions = {
|
|
1681
|
+
/**
|
|
1682
|
+
* The port to listen on.
|
|
1683
|
+
*/
|
|
1684
|
+
port?: number;
|
|
1685
|
+
/**
|
|
1686
|
+
* The host to listen on.
|
|
1687
|
+
*/
|
|
1688
|
+
host?: string;
|
|
1689
|
+
/**
|
|
1690
|
+
* The backlog of connections.
|
|
1691
|
+
*/
|
|
1692
|
+
backlog?: number;
|
|
1693
|
+
/**
|
|
1694
|
+
* The path for Unix socket.
|
|
1695
|
+
*/
|
|
1696
|
+
path?: string;
|
|
1697
|
+
/**
|
|
1698
|
+
* Whether the server is exclusive.
|
|
1699
|
+
*/
|
|
1700
|
+
exclusive?: boolean;
|
|
1701
|
+
/**
|
|
1702
|
+
* Whether the socket is readable by all users.
|
|
1703
|
+
*/
|
|
1704
|
+
readableAll?: boolean;
|
|
1705
|
+
/**
|
|
1706
|
+
* Whether the socket is writable by all users.
|
|
1707
|
+
*/
|
|
1708
|
+
writableAll?: boolean;
|
|
1709
|
+
/**
|
|
1710
|
+
* Whether to use IPv6 only.
|
|
1711
|
+
*/
|
|
1712
|
+
ipv6Only?: boolean;
|
|
1713
|
+
};
|
|
1714
|
+
/**
|
|
1715
|
+
* Options for lazy compilation.
|
|
1716
|
+
*/
|
|
1717
|
+
export type LazyCompilationOptions = {
|
|
1718
|
+
/**
|
|
1719
|
+
* Backend configuration for lazy compilation.
|
|
1720
|
+
*/
|
|
1721
|
+
backend?: {
|
|
1722
|
+
/**
|
|
1723
|
+
* Client script path.
|
|
1724
|
+
*/
|
|
1725
|
+
client?: string;
|
|
1726
|
+
/**
|
|
1727
|
+
* Listening options.
|
|
1728
|
+
*/
|
|
1729
|
+
listen?: number | ListenOptions;
|
|
1730
|
+
/**
|
|
1731
|
+
* Protocol to use.
|
|
1732
|
+
*/
|
|
1733
|
+
protocol?: "http" | "https";
|
|
1734
|
+
};
|
|
1735
|
+
/**
|
|
1736
|
+
* Enable lazy compilation for imports.
|
|
1737
|
+
*/
|
|
1738
|
+
imports?: boolean;
|
|
1739
|
+
/**
|
|
1740
|
+
* Enable lazy compilation for entries.
|
|
1741
|
+
*/
|
|
1742
|
+
entries?: boolean;
|
|
1743
|
+
/**
|
|
1744
|
+
* Test function or regex to determine which modules to include.
|
|
1745
|
+
*/
|
|
1746
|
+
test?: RegExp | ((module: any) => boolean);
|
|
1747
|
+
};
|
|
1748
|
+
/**
|
|
1749
|
+
* Options for incremental builds.
|
|
1750
|
+
*/
|
|
1751
|
+
export type Incremental = {
|
|
1752
|
+
/**
|
|
1753
|
+
* Enable incremental make.
|
|
1754
|
+
*/
|
|
1755
|
+
make?: boolean;
|
|
1756
|
+
/**
|
|
1757
|
+
* Enable incremental asset emission.
|
|
1758
|
+
*/
|
|
1759
|
+
emitAssets?: boolean;
|
|
1760
|
+
/**
|
|
1761
|
+
* Enable inference of async modules.
|
|
1762
|
+
*/
|
|
1763
|
+
inferAsyncModules?: boolean;
|
|
1764
|
+
/**
|
|
1765
|
+
* Enable incremental provided exports.
|
|
1766
|
+
*/
|
|
1767
|
+
providedExports?: boolean;
|
|
1768
|
+
/**
|
|
1769
|
+
* Enables diagnostics for dependencies.
|
|
1770
|
+
*/
|
|
1771
|
+
dependenciesDiagnostics?: boolean;
|
|
1772
|
+
/**
|
|
1773
|
+
* Enable incremental module hashes.
|
|
1774
|
+
*/
|
|
1775
|
+
modulesHashes?: boolean;
|
|
1776
|
+
/**
|
|
1777
|
+
* Enable incremental module code generation.
|
|
1778
|
+
*/
|
|
1779
|
+
modulesCodegen?: boolean;
|
|
1780
|
+
/**
|
|
1781
|
+
* Enable incremental module runtime requirements.
|
|
1782
|
+
*/
|
|
1783
|
+
modulesRuntimeRequirements?: boolean;
|
|
1784
|
+
/**
|
|
1785
|
+
* Enable incremental build chunk graph.
|
|
1786
|
+
*/
|
|
1787
|
+
buildChunkGraph?: boolean;
|
|
1788
|
+
};
|
|
1789
|
+
/**
|
|
1790
|
+
* Experimental features configuration.
|
|
1791
|
+
*/
|
|
1792
|
+
export type Experiments = {
|
|
1793
|
+
/**
|
|
1794
|
+
* Enable lazy compilation.
|
|
1795
|
+
*/
|
|
1796
|
+
lazyCompilation?: boolean | LazyCompilationOptions;
|
|
1797
|
+
/**
|
|
1798
|
+
* Enable async WebAssembly.
|
|
1799
|
+
* Support the new WebAssembly according to the [updated specification](https://github.com/WebAssembly/esm-integration), it makes a WebAssembly module an async module.
|
|
1800
|
+
*/
|
|
1801
|
+
asyncWebAssembly?: boolean;
|
|
1802
|
+
/**
|
|
1803
|
+
* Enable output as ES module.
|
|
1804
|
+
*/
|
|
1805
|
+
outputModule?: boolean;
|
|
1806
|
+
/**
|
|
1807
|
+
* Enable top-level await.
|
|
1808
|
+
*/
|
|
1809
|
+
topLevelAwait?: boolean;
|
|
1810
|
+
/**
|
|
1811
|
+
* Enable CSS support.
|
|
1812
|
+
*
|
|
1813
|
+
* @description
|
|
1814
|
+
* Once enabled, Rspack will enable native CSS support, and CSS related parser and generator options.
|
|
1815
|
+
* - `module.parser["css/auto"]`
|
|
1816
|
+
* - `module.parser.css`
|
|
1817
|
+
* - `module.parser["css/module"]`
|
|
1818
|
+
* - `module.generator["css/auto"]`
|
|
1819
|
+
* - `module.generator.css`
|
|
1820
|
+
* - `module.generator["css/module"]`
|
|
1821
|
+
*/
|
|
1822
|
+
css?: boolean;
|
|
1823
|
+
/**
|
|
1824
|
+
* Enable module layers feature.
|
|
1825
|
+
* @default false
|
|
1826
|
+
*/
|
|
1827
|
+
layers?: boolean;
|
|
1828
|
+
/**
|
|
1829
|
+
* Enable incremental builds.
|
|
1830
|
+
*/
|
|
1831
|
+
incremental?: boolean | Incremental;
|
|
1832
|
+
/**
|
|
1833
|
+
* Enable future default options.
|
|
1834
|
+
*/
|
|
1835
|
+
futureDefaults?: boolean;
|
|
1836
|
+
/**
|
|
1837
|
+
* Enable future Rspack features default options.
|
|
1838
|
+
*/
|
|
1839
|
+
rspackFuture?: RspackFutureOptions;
|
|
1840
|
+
};
|
|
1841
|
+
export type Watch = boolean;
|
|
1842
|
+
/** Options for watch mode. */
|
|
1843
|
+
export type WatchOptions = {
|
|
1844
|
+
/**
|
|
1845
|
+
* Add a delay before rebuilding once the first file changed.
|
|
1846
|
+
* This allows webpack to aggregate any other changes made during this time period into one rebuild.
|
|
1847
|
+
* @default 5
|
|
1848
|
+
*/
|
|
1849
|
+
aggregateTimeout?: number;
|
|
1850
|
+
/**
|
|
1851
|
+
* Follow symlinks while looking for files.
|
|
1852
|
+
* This is usually not needed as webpack already resolves symlinks ('resolve.symlinks' and 'resolve.alias').
|
|
1853
|
+
*/
|
|
1854
|
+
followSymlinks?: boolean;
|
|
1855
|
+
/**
|
|
1856
|
+
* Ignore some files from being watched.
|
|
1857
|
+
*/
|
|
1858
|
+
ignored?: string | RegExp | string[];
|
|
1859
|
+
/**
|
|
1860
|
+
* Turn on polling by passing true, or specifying a poll interval in milliseconds.
|
|
1861
|
+
* @default false
|
|
1862
|
+
*/
|
|
1863
|
+
poll?: number | boolean;
|
|
1864
|
+
/**
|
|
1865
|
+
* Stop watching when stdin stream has ended.
|
|
1866
|
+
*/
|
|
1867
|
+
stdin?: boolean;
|
|
1868
|
+
};
|
|
1869
|
+
/**
|
|
1870
|
+
* Options for devServer, it based on `webpack-dev-server@5`
|
|
1871
|
+
* */
|
|
1872
|
+
export interface DevServer extends webpackDevServer.Configuration {
|
|
1873
|
+
}
|
|
1874
|
+
/**
|
|
1875
|
+
* An array of either regular expressions or functions that determine if a warning should be ignored.
|
|
1876
|
+
*/
|
|
1877
|
+
export type IgnoreWarnings = (RegExp | ((error: Error, compilation: Compilation) => boolean))[];
|
|
1878
|
+
/**
|
|
1879
|
+
* Capture a "profile" of the application, including statistics and hints, which can then be dissected using the Analyze tool.
|
|
1880
|
+
* */
|
|
1881
|
+
export type Profile = boolean;
|
|
1882
|
+
/**
|
|
1883
|
+
* Fail out on the first error instead of tolerating it.
|
|
1884
|
+
* @default false
|
|
1885
|
+
* */
|
|
1886
|
+
export type Bail = boolean;
|
|
1887
|
+
/** Options to control how Rspack notifies you of assets and entry points that exceed a specific file limit. */
|
|
1888
|
+
export type Performance = false | {
|
|
1889
|
+
/**
|
|
1890
|
+
* Filter function to select assets that are checked.
|
|
1891
|
+
*/
|
|
1892
|
+
assetFilter?: (assetFilename: string) => boolean;
|
|
1893
|
+
/**
|
|
1894
|
+
* Sets the format of the hints: warnings, errors or nothing at all.
|
|
1895
|
+
*/
|
|
1896
|
+
hints?: false | "warning" | "error";
|
|
1897
|
+
/**
|
|
1898
|
+
* File size limit (in bytes) when exceeded, that webpack will provide performance hints.
|
|
1899
|
+
* @default 250000
|
|
1900
|
+
*/
|
|
1901
|
+
maxAssetSize?: number;
|
|
1902
|
+
/**
|
|
1903
|
+
* Total size of an entry point (in bytes).
|
|
1904
|
+
* @default 250000
|
|
1905
|
+
*/
|
|
1906
|
+
maxEntrypointSize?: number;
|
|
1907
|
+
};
|
|
1908
|
+
export type RspackOptions = {
|
|
1909
|
+
/**
|
|
1910
|
+
* The name of the Rspack configuration.
|
|
1911
|
+
*/
|
|
1912
|
+
name?: Name;
|
|
1913
|
+
/**
|
|
1914
|
+
* An array of dependencies required by the project.
|
|
1915
|
+
*/
|
|
1916
|
+
dependencies?: Dependencies;
|
|
1917
|
+
/**
|
|
1918
|
+
* The entry point of the application.
|
|
1919
|
+
*/
|
|
1920
|
+
entry?: Entry;
|
|
1921
|
+
/**
|
|
1922
|
+
* Configuration for the output of the compilation.
|
|
1923
|
+
*/
|
|
1924
|
+
output?: Output;
|
|
1925
|
+
/**
|
|
1926
|
+
* The environment in which the code should run.
|
|
1927
|
+
*/
|
|
1928
|
+
target?: Target;
|
|
1929
|
+
/**
|
|
1930
|
+
* The mode in which Rspack should operate.
|
|
1931
|
+
*/
|
|
1932
|
+
mode?: Mode;
|
|
1933
|
+
/**
|
|
1934
|
+
* Options for experimental features.
|
|
1935
|
+
*/
|
|
1936
|
+
experiments?: Experiments;
|
|
1937
|
+
/**
|
|
1938
|
+
* External libraries that should not be bundled.
|
|
1939
|
+
*/
|
|
1940
|
+
externals?: Externals;
|
|
1941
|
+
/**
|
|
1942
|
+
* The type of externals.
|
|
1943
|
+
*/
|
|
1944
|
+
externalsType?: ExternalsType;
|
|
1945
|
+
/**
|
|
1946
|
+
* Presets for external libraries.
|
|
1947
|
+
*/
|
|
1948
|
+
externalsPresets?: ExternalsPresets;
|
|
1949
|
+
/**
|
|
1950
|
+
* Logging options for infrastructure.
|
|
1951
|
+
*/
|
|
1952
|
+
infrastructureLogging?: InfrastructureLogging;
|
|
1953
|
+
/**
|
|
1954
|
+
* Options for caching.
|
|
1955
|
+
*/
|
|
1956
|
+
cache?: CacheOptions;
|
|
1957
|
+
/**
|
|
1958
|
+
* The context in which the compilation should occur.
|
|
1959
|
+
*/
|
|
1960
|
+
context?: Context;
|
|
1961
|
+
/**
|
|
1962
|
+
* The source map configuration.
|
|
1963
|
+
*/
|
|
1964
|
+
devtool?: DevTool;
|
|
1965
|
+
/**
|
|
1966
|
+
* Options for Node.js environment.
|
|
1967
|
+
*/
|
|
1968
|
+
node?: Node;
|
|
1969
|
+
/**
|
|
1970
|
+
* Configuration for loaders.
|
|
1971
|
+
*/
|
|
1972
|
+
loader?: Loader;
|
|
1973
|
+
/**
|
|
1974
|
+
* Warnings to ignore during compilation.
|
|
1975
|
+
*/
|
|
1976
|
+
ignoreWarnings?: IgnoreWarnings;
|
|
1977
|
+
/**
|
|
1978
|
+
* Options for watch mode.
|
|
1979
|
+
*/
|
|
1980
|
+
watchOptions?: WatchOptions;
|
|
1981
|
+
/**
|
|
1982
|
+
* Whether to enable watch mode.
|
|
1983
|
+
*/
|
|
1984
|
+
watch?: Watch;
|
|
1985
|
+
/**
|
|
1986
|
+
* Options for the stats output.
|
|
1987
|
+
*/
|
|
1988
|
+
stats?: StatsValue;
|
|
1989
|
+
/**
|
|
1990
|
+
* Options for snapshotting.
|
|
1991
|
+
*/
|
|
1992
|
+
snapshot?: SnapshotOptions;
|
|
1993
|
+
/**
|
|
1994
|
+
* Optimization options.
|
|
1995
|
+
*/
|
|
1996
|
+
optimization?: Optimization;
|
|
1997
|
+
/**
|
|
1998
|
+
* Options for resolving modules.
|
|
1999
|
+
*/
|
|
2000
|
+
resolve?: ResolveOptions;
|
|
2001
|
+
/**
|
|
2002
|
+
* Options for resolving loader modules.
|
|
2003
|
+
*/
|
|
2004
|
+
resolveLoader?: ResolveOptions;
|
|
2005
|
+
/**
|
|
2006
|
+
* Plugins to use during compilation.
|
|
2007
|
+
*/
|
|
2008
|
+
plugins?: Plugins;
|
|
2009
|
+
/**
|
|
2010
|
+
* Configuration for the development server.
|
|
2011
|
+
*/
|
|
2012
|
+
devServer?: DevServer;
|
|
2013
|
+
/**
|
|
2014
|
+
* Options for module configuration.
|
|
2015
|
+
*/
|
|
2016
|
+
module?: ModuleOptions;
|
|
2017
|
+
/**
|
|
2018
|
+
* Whether to capture a profile of the application.
|
|
2019
|
+
*/
|
|
2020
|
+
profile?: Profile;
|
|
2021
|
+
/**
|
|
2022
|
+
* Whether to fail on the first error.
|
|
2023
|
+
*/
|
|
2024
|
+
bail?: Bail;
|
|
2025
|
+
/**
|
|
2026
|
+
* Performance optimization options.
|
|
2027
|
+
*/
|
|
2028
|
+
performance?: Performance;
|
|
2029
|
+
};
|
|
2030
|
+
/** Configuration for Rspack */
|
|
2031
|
+
export type Configuration = RspackOptions;
|
|
1146
2032
|
export {};
|