@rspack/browser 1.7.1 → 2.0.0-canary-20260116
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/Compilation.d.ts +2 -2
- package/dist/MultiCompiler.d.ts +1 -1
- package/dist/RuntimeModule.d.ts +3 -1
- package/dist/browser/service.d.ts +1 -1
- package/dist/builtin-loader/lightningcss/index.d.ts +0 -5
- package/dist/builtin-loader/swc/types.d.ts +0 -6
- package/dist/builtin-plugin/EnableChunkLoadingPlugin.d.ts +1 -1
- package/dist/builtin-plugin/JsLoaderRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/LightningCssMinimizerRspackPlugin.d.ts +0 -5
- package/dist/builtin-plugin/RsdoctorPlugin.d.ts +1 -5
- package/dist/builtin-plugin/RuntimePlugin.d.ts +0 -4
- package/dist/builtin-plugin/SubresourceIntegrityPlugin.d.ts +1 -1
- package/dist/builtin-plugin/html-plugin/options.d.ts +0 -5
- package/dist/builtin-plugin/html-plugin/plugin.d.ts +1 -5
- package/dist/config/normalization.d.ts +4 -32
- package/dist/config/target.d.ts +2 -0
- package/dist/config/types.d.ts +62 -144
- package/dist/exports.d.ts +2 -14
- package/dist/index.js +34866 -0
- package/dist/{index.mjs.LICENSE.txt → index.js.LICENSE.txt} +0 -7
- package/dist/lib/DllPlugin.d.ts +1 -1
- package/dist/lib/DllReferencePlugin.d.ts +2 -2
- package/dist/napi-binding.d.ts +23 -29
- package/dist/rslib-runtime.js +29 -0
- package/dist/rspack.wasm32-wasi.wasm +0 -0
- package/dist/runtime/moduleFederationDefaultRuntime.d.ts +1 -2
- package/dist/stats/statsFactoryUtils.d.ts +0 -3
- package/package.json +1 -1
- package/dist/index.mjs +0 -67227
- package/dist/rslib-runtime.mjs +0 -68
package/dist/Compilation.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* Copyright (c) JS Foundation and other contributors
|
|
8
8
|
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
9
|
*/
|
|
10
|
-
import type { AssetInfo, ChunkGroup, Dependency, ExternalObject, JsCompilation
|
|
10
|
+
import type { AssetInfo, ChunkGroup, Dependency, ExternalObject, JsCompilation } from '@rspack/binding';
|
|
11
11
|
import binding from '@rspack/binding';
|
|
12
12
|
export type { AssetInfo } from '@rspack/binding';
|
|
13
13
|
import * as liteTapable from '@rspack/lite-tapable';
|
|
@@ -185,7 +185,7 @@ export declare class Compilation {
|
|
|
185
185
|
Set<string>
|
|
186
186
|
]>;
|
|
187
187
|
runtimeRequirementInTree: liteTapable.HookMap<liteTapable.SyncBailHook<[Chunk, Set<string>], void>>;
|
|
188
|
-
runtimeModule: liteTapable.SyncHook<[
|
|
188
|
+
runtimeModule: liteTapable.SyncHook<[RuntimeModule, Chunk]>;
|
|
189
189
|
seal: liteTapable.SyncHook<[]>;
|
|
190
190
|
afterSeal: liteTapable.AsyncSeriesHook<[], void>;
|
|
191
191
|
needAdditionalPass: liteTapable.SyncBailHook<[], boolean>;
|
package/dist/MultiCompiler.d.ts
CHANGED
|
@@ -42,7 +42,7 @@ export declare class MultiCompiler {
|
|
|
42
42
|
watching?: MultiWatching;
|
|
43
43
|
constructor(compilers: Compiler[] | Record<string, Compiler>, options?: MultiCompilerOptions);
|
|
44
44
|
set unsafeFastDrop(value: boolean);
|
|
45
|
-
get options(): import("
|
|
45
|
+
get options(): import("./config").RspackOptionsNormalized[] & MultiCompilerOptions;
|
|
46
46
|
get outputPath(): string;
|
|
47
47
|
get inputFileSystem(): InputFileSystem;
|
|
48
48
|
get outputFileSystem(): typeof import("fs");
|
package/dist/RuntimeModule.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { JsAddingRuntimeModule } from '@rspack/binding';
|
|
1
|
+
import type { JsAddingRuntimeModule, JsRuntimeModule, JsSource } from '@rspack/binding';
|
|
2
2
|
import type { Chunk } from './Chunk';
|
|
3
3
|
import type { ChunkGraph } from './ChunkGraph';
|
|
4
4
|
import type { Compilation } from './Compilation';
|
|
@@ -23,6 +23,7 @@ export declare class RuntimeModule {
|
|
|
23
23
|
protected chunkGraph: ChunkGraph | null;
|
|
24
24
|
constructor(name: string, stage?: RuntimeModuleStage);
|
|
25
25
|
attach(compilation: Compilation, chunk: Chunk, chunkGraph: ChunkGraph): void;
|
|
26
|
+
get source(): JsSource | undefined;
|
|
26
27
|
get name(): string;
|
|
27
28
|
get stage(): RuntimeModuleStage;
|
|
28
29
|
identifier(): string;
|
|
@@ -30,3 +31,4 @@ export declare class RuntimeModule {
|
|
|
30
31
|
shouldIsolate(): boolean;
|
|
31
32
|
generate(): string;
|
|
32
33
|
}
|
|
34
|
+
export declare function createRenderedRuntimeModule(module: JsRuntimeModule): RuntimeModule;
|
|
@@ -105,11 +105,6 @@ export type LoaderOptions = {
|
|
|
105
105
|
targets?: Targets | string[] | string;
|
|
106
106
|
include?: FeatureOptions;
|
|
107
107
|
exclude?: FeatureOptions;
|
|
108
|
-
/**
|
|
109
|
-
* @deprecated Use `drafts` instead.
|
|
110
|
-
* This will be removed in the next major version.
|
|
111
|
-
*/
|
|
112
|
-
draft?: Drafts;
|
|
113
108
|
drafts?: Drafts;
|
|
114
109
|
nonStandard?: NonStandard;
|
|
115
110
|
pseudoClasses?: PseudoClasses;
|
|
@@ -21,12 +21,6 @@ export type SwcLoaderOptions = Config & {
|
|
|
21
21
|
*/
|
|
22
22
|
rspackExperiments?: {
|
|
23
23
|
import?: PluginImportOptions;
|
|
24
|
-
/**
|
|
25
|
-
* @deprecated Use top-level `collectTypeScriptInfo` instead.
|
|
26
|
-
* Collects information from TypeScript's AST for consumption by subsequent Rspack processes,
|
|
27
|
-
* providing better TypeScript development experience and smaller output bundle size.
|
|
28
|
-
*/
|
|
29
|
-
collectTypeScriptInfo?: CollectTypeScriptInfoOptions;
|
|
30
24
|
};
|
|
31
25
|
};
|
|
32
26
|
export interface TerserCompressOptions {
|
|
@@ -12,7 +12,7 @@ declare const EnableChunkLoadingPluginInner: {
|
|
|
12
12
|
new (type: string): {
|
|
13
13
|
name: string;
|
|
14
14
|
_args: [type: string];
|
|
15
|
-
affectedHooks: keyof import("
|
|
15
|
+
affectedHooks: keyof import("..").CompilerHooks | undefined;
|
|
16
16
|
raw(compiler: Compiler): import("../binding").BuiltinPlugin;
|
|
17
17
|
apply(compiler: Compiler): void;
|
|
18
18
|
};
|
|
@@ -3,7 +3,7 @@ export declare const JsLoaderRspackPlugin: {
|
|
|
3
3
|
new (compiler: Compiler): {
|
|
4
4
|
name: string;
|
|
5
5
|
_args: [compiler: Compiler];
|
|
6
|
-
affectedHooks: keyof import("
|
|
6
|
+
affectedHooks: keyof import("..").CompilerHooks | undefined;
|
|
7
7
|
raw(compiler: Compiler): import("../binding").BuiltinPlugin;
|
|
8
8
|
apply(compiler: Compiler): void;
|
|
9
9
|
};
|
|
@@ -10,11 +10,6 @@ export type LightningCssMinimizerRspackPluginOptions = {
|
|
|
10
10
|
targets?: string[] | string;
|
|
11
11
|
include?: FeatureOptions;
|
|
12
12
|
exclude?: FeatureOptions;
|
|
13
|
-
/**
|
|
14
|
-
* @deprecated Use `drafts` instead.
|
|
15
|
-
* This will be removed in the next major version.
|
|
16
|
-
*/
|
|
17
|
-
draft?: Drafts;
|
|
18
13
|
drafts?: Drafts;
|
|
19
14
|
nonStandard?: NonStandard;
|
|
20
15
|
pseudoClasses?: PseudoClasses;
|
|
@@ -18,7 +18,7 @@ declare const RsdoctorPluginImpl: {
|
|
|
18
18
|
new (c?: RsdoctorPluginOptions | undefined): {
|
|
19
19
|
name: string;
|
|
20
20
|
_args: [c?: RsdoctorPluginOptions | undefined];
|
|
21
|
-
affectedHooks: keyof import("
|
|
21
|
+
affectedHooks: keyof import("..").CompilerHooks | undefined;
|
|
22
22
|
raw(compiler: Compiler): import("../binding").BuiltinPlugin;
|
|
23
23
|
apply(compiler: Compiler): void;
|
|
24
24
|
};
|
|
@@ -39,10 +39,6 @@ export type RsdoctorPluginHooks = {
|
|
|
39
39
|
assets: liteTapable.AsyncSeriesBailHook<[JsRsdoctorAssetPatch], false | void>;
|
|
40
40
|
};
|
|
41
41
|
declare const RsdoctorPlugin: typeof RsdoctorPluginImpl & {
|
|
42
|
-
/**
|
|
43
|
-
* @deprecated Use `getCompilationHooks` instead.
|
|
44
|
-
*/
|
|
45
|
-
getHooks: (compilation: Compilation) => RsdoctorPluginHooks;
|
|
46
42
|
getCompilationHooks: (compilation: Compilation) => RsdoctorPluginHooks;
|
|
47
43
|
};
|
|
48
44
|
export declare const createRsdoctorPluginHooksRegisters: CreatePartialRegisters<`RsdoctorPlugin`>;
|
|
@@ -19,10 +19,6 @@ export type RuntimePluginHooks = {
|
|
|
19
19
|
linkPrefetch: liteTapable.SyncWaterfallHook<[string, Chunk]>;
|
|
20
20
|
};
|
|
21
21
|
declare const RuntimePlugin: typeof RuntimePluginImpl & {
|
|
22
|
-
/**
|
|
23
|
-
* @deprecated Use `getCompilationHooks` instead.
|
|
24
|
-
*/
|
|
25
|
-
getHooks: (compilation: Compilation) => RuntimePluginHooks;
|
|
26
22
|
getCompilationHooks: (compilation: Compilation) => RuntimePluginHooks;
|
|
27
23
|
};
|
|
28
24
|
export declare const createRuntimePluginHooksRegisters: CreatePartialRegisters<`RuntimePlugin`>;
|
|
@@ -20,7 +20,7 @@ declare const NativeSubresourceIntegrityPlugin: {
|
|
|
20
20
|
new (options: NativeSubresourceIntegrityPluginOptions): {
|
|
21
21
|
name: string;
|
|
22
22
|
_args: [options: NativeSubresourceIntegrityPluginOptions];
|
|
23
|
-
affectedHooks: keyof import("
|
|
23
|
+
affectedHooks: keyof import("..").CompilerHooks | undefined;
|
|
24
24
|
raw(compiler: Compiler): import("../binding").BuiltinPlugin;
|
|
25
25
|
apply(compiler: Compiler): void;
|
|
26
26
|
};
|
|
@@ -52,11 +52,6 @@ export type HtmlRspackPluginOptions = {
|
|
|
52
52
|
* @default "auto"
|
|
53
53
|
*/
|
|
54
54
|
chunksSortMode?: 'auto' | 'manual';
|
|
55
|
-
/**
|
|
56
|
-
* Configure the SRI hash algorithm, which is disabled by default.
|
|
57
|
-
* @deprecated Use `experiments.SubresourceIntegrityPlugin` instead.
|
|
58
|
-
*/
|
|
59
|
-
sri?: 'sha256' | 'sha384' | 'sha512';
|
|
60
55
|
/**
|
|
61
56
|
* Controls whether to minify the output, disabled by default.
|
|
62
57
|
*/
|
|
@@ -7,16 +7,12 @@ declare const HtmlRspackPluginImpl: {
|
|
|
7
7
|
new (c?: HtmlRspackPluginOptions | undefined): {
|
|
8
8
|
name: string;
|
|
9
9
|
_args: [c?: HtmlRspackPluginOptions | undefined];
|
|
10
|
-
affectedHooks: keyof import("
|
|
10
|
+
affectedHooks: keyof import("../..").CompilerHooks | undefined;
|
|
11
11
|
raw(compiler: Compiler): import("../../binding").BuiltinPlugin;
|
|
12
12
|
apply(compiler: Compiler): void;
|
|
13
13
|
};
|
|
14
14
|
};
|
|
15
15
|
declare const HtmlRspackPlugin: typeof HtmlRspackPluginImpl & {
|
|
16
|
-
/**
|
|
17
|
-
* @deprecated Use `getCompilationHooks` instead.
|
|
18
|
-
*/
|
|
19
|
-
getHooks: (compilation: Compilation) => HtmlRspackPluginHooks;
|
|
20
16
|
getCompilationHooks: (compilation: Compilation) => HtmlRspackPluginHooks;
|
|
21
17
|
createHtmlTagObject: (tagName: string, attributes?: Record<string, string | boolean>, innerHTML?: string) => JsHtmlPluginTag;
|
|
22
18
|
version: number;
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
import type { HttpUriPluginOptions } from '../builtin-plugin';
|
|
11
11
|
import type { Compilation } from '../Compilation';
|
|
12
12
|
import type WebpackError from '../lib/WebpackError';
|
|
13
|
-
import type { Amd, AssetModuleFilename, Bail,
|
|
13
|
+
import type { Amd, AssetModuleFilename, Bail, BundlerInfoOptions, ChunkFilename, ChunkLoading, ChunkLoadingGlobal, Clean, Context, CrossOriginLoading, CssChunkFilename, CssFilename, Dependencies, DevServer, DevTool, DevtoolFallbackModuleFilenameTemplate, DevtoolModuleFilenameTemplate, DevtoolNamespace, EnabledLibraryTypes, EnabledWasmLoadingTypes, EntryDescription, Environment, Externals, ExternalsPresets, ExternalsType, Filename, GeneratorOptionsByModuleType, GlobalObject, HashDigest, HashDigestLength, HashFunction, HashSalt, HotUpdateChunkFilename, HotUpdateGlobal, HotUpdateMainFilename, Iife, ImportFunctionName, ImportMetaName, Incremental, InfrastructureLogging, LazyCompilationOptions, LibraryOptions, Loader, Mode, Name, Node, NoParseOption, Optimization, OutputModule, ParserOptionsByModuleType, Path, Performance, Plugins, PublicPath, Resolve, RspackOptions, RuleSetRules, ScriptType, SnapshotOptions, SourceMapFilename, StatsValue, StrictModuleErrorHandling, Target, TrustedTypes, UniqueName, WasmLoading, Watch, WatchOptions, WebassemblyModuleFilename, WorkerPublicPath } from './types';
|
|
14
14
|
export declare const getNormalizedRspackOptions: (config: RspackOptions) => RspackOptionsNormalized;
|
|
15
15
|
export type EntryDynamicNormalized = () => Promise<EntryStaticNormalized>;
|
|
16
16
|
export type EntryNormalized = EntryDynamicNormalized | EntryStaticNormalized;
|
|
@@ -66,9 +66,9 @@ export interface OutputNormalized {
|
|
|
66
66
|
devtoolModuleFilenameTemplate?: DevtoolModuleFilenameTemplate;
|
|
67
67
|
devtoolFallbackModuleFilenameTemplate?: DevtoolFallbackModuleFilenameTemplate;
|
|
68
68
|
environment?: Environment;
|
|
69
|
-
charset?: boolean;
|
|
70
69
|
chunkLoadTimeout?: number;
|
|
71
70
|
compareBeforeEmit?: boolean;
|
|
71
|
+
bundlerInfo?: BundlerInfoOptions;
|
|
72
72
|
}
|
|
73
73
|
export interface ModuleOptionsNormalized {
|
|
74
74
|
defaultRules?: RuleSetRules;
|
|
@@ -78,7 +78,7 @@ export interface ModuleOptionsNormalized {
|
|
|
78
78
|
noParse?: NoParseOption;
|
|
79
79
|
unsafeCache?: boolean | RegExp;
|
|
80
80
|
}
|
|
81
|
-
export type
|
|
81
|
+
export type CacheNormalized = boolean | {
|
|
82
82
|
type: 'memory';
|
|
83
83
|
} | {
|
|
84
84
|
type: 'persistent';
|
|
@@ -95,40 +95,13 @@ export type ExperimentCacheNormalized = boolean | {
|
|
|
95
95
|
};
|
|
96
96
|
};
|
|
97
97
|
export interface ExperimentsNormalized {
|
|
98
|
-
cache?: ExperimentCacheNormalized;
|
|
99
|
-
/**
|
|
100
|
-
* @deprecated This option is deprecated and will be removed in future versions.
|
|
101
|
-
*
|
|
102
|
-
* Please use the Configuration top-level `lazyCompilation` option instead.
|
|
103
|
-
*/
|
|
104
|
-
lazyCompilation?: false | LazyCompilationOptions;
|
|
105
98
|
asyncWebAssembly?: boolean;
|
|
106
99
|
outputModule?: boolean;
|
|
107
|
-
topLevelAwait?: boolean;
|
|
108
100
|
css?: boolean;
|
|
109
|
-
/**
|
|
110
|
-
* @deprecated This option is deprecated, layers is enabled since v1.6.0
|
|
111
|
-
*/
|
|
112
|
-
layers?: boolean;
|
|
113
101
|
incremental?: false | Incremental;
|
|
114
102
|
futureDefaults?: boolean;
|
|
115
|
-
rspackFuture?: RspackFutureOptions;
|
|
116
103
|
buildHttp?: HttpUriPluginOptions;
|
|
117
|
-
parallelLoader?: boolean;
|
|
118
104
|
useInputFileSystem?: false | RegExp[];
|
|
119
|
-
/**
|
|
120
|
-
* @deprecated This option is deprecated, it's already stable and enabled by default, Rspack will remove this option in future version
|
|
121
|
-
*/
|
|
122
|
-
inlineConst?: boolean;
|
|
123
|
-
/**
|
|
124
|
-
* @deprecated This option is deprecated, it's already stable and enabled by default, Rspack will remove this option in future version
|
|
125
|
-
*/
|
|
126
|
-
inlineEnum?: boolean;
|
|
127
|
-
typeReexportsPresence?: boolean;
|
|
128
|
-
/**
|
|
129
|
-
* @deprecated This option is deprecated, it's already stable and enabled by default, Rspack will remove this option in future version
|
|
130
|
-
*/
|
|
131
|
-
lazyBarrel?: boolean;
|
|
132
105
|
nativeWatcher?: boolean;
|
|
133
106
|
deferImport?: boolean;
|
|
134
107
|
}
|
|
@@ -157,7 +130,7 @@ export interface RspackOptionsNormalized {
|
|
|
157
130
|
node: Node;
|
|
158
131
|
loader: Loader;
|
|
159
132
|
snapshot: SnapshotOptions;
|
|
160
|
-
cache?:
|
|
133
|
+
cache?: CacheNormalized;
|
|
161
134
|
stats: StatsValue;
|
|
162
135
|
optimization: Optimization;
|
|
163
136
|
plugins: Plugins;
|
|
@@ -168,7 +141,6 @@ export interface RspackOptionsNormalized {
|
|
|
168
141
|
devServer?: DevServer;
|
|
169
142
|
ignoreWarnings?: IgnoreWarningsNormalized;
|
|
170
143
|
performance?: Performance;
|
|
171
|
-
profile?: Profile;
|
|
172
144
|
amd?: Amd;
|
|
173
145
|
bail?: Bail;
|
|
174
146
|
}
|
package/dist/config/target.d.ts
CHANGED
|
@@ -38,6 +38,8 @@ export type ApiTargetProperties = {
|
|
|
38
38
|
importScripts: boolean | null;
|
|
39
39
|
/** has importScripts available when creating a worker */
|
|
40
40
|
importScriptsInWorker: boolean | null;
|
|
41
|
+
/** node.js allows to use `import.meta.dirname` and `import.meta.filename` */
|
|
42
|
+
importMetaDirnameAndFilename: boolean | null;
|
|
41
43
|
/** has fetch function available for WebAssembly */
|
|
42
44
|
fetchWasm: boolean | null;
|
|
43
45
|
/** has global variable available */
|
package/dist/config/types.d.ts
CHANGED
|
@@ -272,6 +272,8 @@ export type Environment = {
|
|
|
272
272
|
dynamicImport?: boolean;
|
|
273
273
|
/** The environment supports an async import() when creating a worker, only for web targets at the moment. */
|
|
274
274
|
dynamicImportInWorker?: boolean;
|
|
275
|
+
/** The environment supports `import.meta.dirname` and `import.meta.filename`. */
|
|
276
|
+
importMetaDirnameAndFilename?: boolean;
|
|
275
277
|
/** The environment supports 'for of' iteration ('for (const x of array) { ... }'). */
|
|
276
278
|
forOf?: boolean;
|
|
277
279
|
/** The environment supports 'globalThis'. */
|
|
@@ -323,14 +325,6 @@ export type Output = {
|
|
|
323
325
|
crossOriginLoading?: CrossOriginLoading;
|
|
324
326
|
/** This option determines the name of CSS output files on disk. */
|
|
325
327
|
cssFilename?: CssFilename;
|
|
326
|
-
/**
|
|
327
|
-
* @deprecated this config is unused, and will be removed in the future.
|
|
328
|
-
* Rspack adds some metadata in CSS to parse CSS modules, and this configuration determines whether to compress these metadata.
|
|
329
|
-
*
|
|
330
|
-
* The value is `true` in production mode.
|
|
331
|
-
* The value is `false` in development mode.
|
|
332
|
-
* */
|
|
333
|
-
cssHeadDataCompression?: boolean;
|
|
334
328
|
/** This option determines the name of non-initial CSS output files on disk. */
|
|
335
329
|
cssChunkFilename?: CssChunkFilename;
|
|
336
330
|
/**
|
|
@@ -367,26 +361,6 @@ export type Output = {
|
|
|
367
361
|
enabledLibraryTypes?: EnabledLibraryTypes;
|
|
368
362
|
/** Output a library exposing the exports of your entry point. */
|
|
369
363
|
library?: Library;
|
|
370
|
-
/**
|
|
371
|
-
* Specify which export should be exposed as a library.
|
|
372
|
-
* @deprecated We might drop support for this, so prefer to use output.library.export
|
|
373
|
-
* */
|
|
374
|
-
libraryExport?: LibraryExport;
|
|
375
|
-
/**
|
|
376
|
-
* Configure how the library will be exposed.
|
|
377
|
-
* @deprecated Use output.library.type instead as we might drop support for output.libraryTarget in the future.
|
|
378
|
-
* */
|
|
379
|
-
libraryTarget?: LibraryType;
|
|
380
|
-
/**
|
|
381
|
-
* When using output.library.type: "umd", setting output.umdNamedDefine to true will name the AMD module of the UMD build.
|
|
382
|
-
* @deprecated Use output.library.umdNamedDefine instead.
|
|
383
|
-
*/
|
|
384
|
-
umdNamedDefine?: UmdNamedDefine;
|
|
385
|
-
/**
|
|
386
|
-
* Add a comment in the UMD wrapper.
|
|
387
|
-
* @deprecated use output.library.auxiliaryComment instead.
|
|
388
|
-
* */
|
|
389
|
-
auxiliaryComment?: AuxiliaryComment;
|
|
390
364
|
/**
|
|
391
365
|
* Output JavaScript files as module type.
|
|
392
366
|
* Disabled by default as it's an experimental feature. To use it, you must set experiments.outputModule to true.
|
|
@@ -499,17 +473,16 @@ export type Output = {
|
|
|
499
473
|
* @default 120000
|
|
500
474
|
* */
|
|
501
475
|
chunkLoadTimeout?: number;
|
|
502
|
-
/**
|
|
503
|
-
* Add charset="utf-8" to the HTML <script> tag.
|
|
504
|
-
* @default true
|
|
505
|
-
* */
|
|
506
|
-
charset?: boolean;
|
|
507
476
|
/** Tell Rspack what kind of ES-features may be used in the generated runtime-code. */
|
|
508
477
|
environment?: Environment;
|
|
509
478
|
/**
|
|
510
479
|
* Check if to be emitted file already exists and have the same content before writing to output filesystem.
|
|
511
480
|
*/
|
|
512
481
|
compareBeforeEmit?: boolean;
|
|
482
|
+
/**
|
|
483
|
+
* Information about the bundler.
|
|
484
|
+
*/
|
|
485
|
+
bundlerInfo?: BundlerInfoOptions;
|
|
513
486
|
};
|
|
514
487
|
/**
|
|
515
488
|
* Path alias
|
|
@@ -851,14 +824,35 @@ export type JavascriptParserOptions = {
|
|
|
851
824
|
worker?: string[] | boolean;
|
|
852
825
|
/** Override the module to strict or non-strict. */
|
|
853
826
|
overrideStrict?: 'strict' | 'non-strict';
|
|
827
|
+
/**
|
|
828
|
+
* Control whether renaming of the CommonJS `require` function will be parsed and transformed.
|
|
829
|
+
* @default false
|
|
830
|
+
*/
|
|
831
|
+
requireAlias?: boolean;
|
|
832
|
+
/**
|
|
833
|
+
* Control whether `require` used as an expression (e.g., `const req = require; req('./module')`) will be parsed.
|
|
834
|
+
* @default true
|
|
835
|
+
*/
|
|
854
836
|
requireAsExpression?: boolean;
|
|
837
|
+
/**
|
|
838
|
+
* Control whether dynamic `require` calls (e.g., `require(variable)`) will be parsed.
|
|
839
|
+
* @default true
|
|
840
|
+
*/
|
|
855
841
|
requireDynamic?: boolean;
|
|
842
|
+
/**
|
|
843
|
+
* Control whether `require.resolve()` calls will be parsed.
|
|
844
|
+
* @default true
|
|
845
|
+
*/
|
|
856
846
|
requireResolve?: boolean;
|
|
857
847
|
/**
|
|
858
848
|
* CommonJS-specific parser options. `true` enables the default behaviour, `{ exports: 'skipInEsm' }` preserves CommonJS export mutations when executed inside ESM.
|
|
859
849
|
* @default true
|
|
860
850
|
*/
|
|
861
851
|
commonjs?: JavascriptParserCommonjsOption;
|
|
852
|
+
/**
|
|
853
|
+
* Control whether dynamic `import()` calls (e.g., `import(variable)`) will be parsed.
|
|
854
|
+
* @default true
|
|
855
|
+
*/
|
|
862
856
|
importDynamic?: boolean;
|
|
863
857
|
/**
|
|
864
858
|
* Enable magic comments for CommonJS require() expressions.
|
|
@@ -868,7 +862,11 @@ export type JavascriptParserOptions = {
|
|
|
868
862
|
typeReexportsPresence?: 'no-tolerant' | 'tolerant' | 'tolerant-no-check';
|
|
869
863
|
/** Whether to enable JSX parsing */
|
|
870
864
|
jsx?: boolean;
|
|
871
|
-
/**
|
|
865
|
+
/**
|
|
866
|
+
* Whether to enable defer import.
|
|
867
|
+
* This option is controlled by `experiments.deferImport` and should not be set directly.
|
|
868
|
+
* @default false
|
|
869
|
+
*/
|
|
872
870
|
deferImport?: boolean;
|
|
873
871
|
};
|
|
874
872
|
export type JsonParserOptions = {
|
|
@@ -1052,12 +1050,12 @@ type AllowTarget = 'web' | 'webworker' | 'es3' | 'es5' | 'es2015' | 'es2016' | '
|
|
|
1052
1050
|
export type Target = false | AllowTarget | AllowTarget[];
|
|
1053
1051
|
/**
|
|
1054
1052
|
* Specify the default type of externals.
|
|
1055
|
-
* `amd`, `umd`, `system` and `jsonp` externals depend on the `output.
|
|
1053
|
+
* `amd`, `umd`, `system` and `jsonp` externals depend on the `output.library.type` being set to the same value e.g. you can only consume amd externals within an amd library.
|
|
1056
1054
|
* @default 'var'
|
|
1057
1055
|
*/
|
|
1058
1056
|
export type ExternalsType = 'var' | 'module' | 'assign' | 'this' | 'window' | 'self' | 'global' | 'commonjs' | 'commonjs2' | 'commonjs-module' | 'commonjs-static' | 'amd' | 'amd-require' | 'umd' | 'umd2' | 'jsonp' | 'system' | 'promise' | 'import' | 'module-import' | 'script' | 'node-commonjs' | 'commonjs-import';
|
|
1059
1057
|
/**
|
|
1060
|
-
* External item object when both
|
|
1058
|
+
* External item object when both library.type and externalsType is 'umd'
|
|
1061
1059
|
*/
|
|
1062
1060
|
export type ExternalItemUmdValue = {
|
|
1063
1061
|
root: string | string[];
|
|
@@ -1074,7 +1072,7 @@ export type ExternalItemObjectValue = Record<string, string | string[]>;
|
|
|
1074
1072
|
*/
|
|
1075
1073
|
export type ExternalItemValue = string | boolean | string[] | ExternalItemUmdValue
|
|
1076
1074
|
/**
|
|
1077
|
-
* when
|
|
1075
|
+
* when library.type and externalsType is not 'umd'
|
|
1078
1076
|
*/
|
|
1079
1077
|
| ExternalItemObjectValue;
|
|
1080
1078
|
/**
|
|
@@ -1248,7 +1246,22 @@ export type SnapshotOptions = {};
|
|
|
1248
1246
|
* // Disable caching
|
|
1249
1247
|
* cache: false
|
|
1250
1248
|
*/
|
|
1251
|
-
export type CacheOptions = boolean
|
|
1249
|
+
export type CacheOptions = boolean | {
|
|
1250
|
+
type: 'memory';
|
|
1251
|
+
} | {
|
|
1252
|
+
type: 'persistent';
|
|
1253
|
+
buildDependencies?: string[];
|
|
1254
|
+
version?: string;
|
|
1255
|
+
snapshot?: {
|
|
1256
|
+
immutablePaths?: (string | RegExp)[];
|
|
1257
|
+
unmanagedPaths?: (string | RegExp)[];
|
|
1258
|
+
managedPaths?: (string | RegExp)[];
|
|
1259
|
+
};
|
|
1260
|
+
storage?: {
|
|
1261
|
+
type: 'filesystem';
|
|
1262
|
+
directory?: string;
|
|
1263
|
+
};
|
|
1264
|
+
};
|
|
1252
1265
|
export type StatsPresets = 'normal' | 'none' | 'verbose' | 'errors-only' | 'errors-warnings' | 'minimal' | 'detailed' | 'summary';
|
|
1253
1266
|
type ModuleFilterItemTypes = RegExp | string | ((name: string, module: any, type: any) => boolean);
|
|
1254
1267
|
type ModuleFilterTypes = boolean | ModuleFilterItemTypes | ModuleFilterItemTypes[];
|
|
@@ -1910,53 +1923,21 @@ export type Optimization = {
|
|
|
1910
1923
|
avoidEntryIife?: boolean;
|
|
1911
1924
|
};
|
|
1912
1925
|
/**
|
|
1913
|
-
*
|
|
1914
|
-
* @description Controls whether caching is enabled or disabled.
|
|
1915
|
-
* @default true in development mode, false in production mode
|
|
1916
|
-
* @example
|
|
1917
|
-
* // Enable caching
|
|
1918
|
-
* cache: true
|
|
1919
|
-
*
|
|
1920
|
-
* // Disable caching
|
|
1921
|
-
* cache: false
|
|
1926
|
+
* Information about the bundler.
|
|
1922
1927
|
*/
|
|
1923
|
-
export type
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
buildDependencies?: string[];
|
|
1928
|
+
export type BundlerInfoOptions = {
|
|
1929
|
+
/**
|
|
1930
|
+
* Version of the bundler.
|
|
1931
|
+
*/
|
|
1928
1932
|
version?: string;
|
|
1929
|
-
snapshot?: {
|
|
1930
|
-
immutablePaths?: (string | RegExp)[];
|
|
1931
|
-
unmanagedPaths?: (string | RegExp)[];
|
|
1932
|
-
managedPaths?: (string | RegExp)[];
|
|
1933
|
-
};
|
|
1934
|
-
storage?: {
|
|
1935
|
-
type: 'filesystem';
|
|
1936
|
-
directory?: string;
|
|
1937
|
-
};
|
|
1938
|
-
};
|
|
1939
|
-
/**
|
|
1940
|
-
* Options for future Rspack features.
|
|
1941
|
-
*/
|
|
1942
|
-
export type RspackFutureOptions = {
|
|
1943
1933
|
/**
|
|
1944
|
-
*
|
|
1934
|
+
* Name of the bundler.
|
|
1945
1935
|
*/
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
/**
|
|
1952
|
-
* Name of the bundler.
|
|
1953
|
-
*/
|
|
1954
|
-
bundler?: string;
|
|
1955
|
-
/**
|
|
1956
|
-
* Force specific features.
|
|
1957
|
-
*/
|
|
1958
|
-
force?: boolean | ('version' | 'uniqueId')[];
|
|
1959
|
-
};
|
|
1936
|
+
bundler?: string;
|
|
1937
|
+
/**
|
|
1938
|
+
* Force specific features.
|
|
1939
|
+
*/
|
|
1940
|
+
force?: boolean | ('version' | 'uniqueId')[];
|
|
1960
1941
|
};
|
|
1961
1942
|
/**
|
|
1962
1943
|
* Options for lazy compilation.
|
|
@@ -2080,16 +2061,6 @@ export type UseInputFileSystem = false | RegExp[];
|
|
|
2080
2061
|
* Experimental features configuration.
|
|
2081
2062
|
*/
|
|
2082
2063
|
export type Experiments = {
|
|
2083
|
-
/**
|
|
2084
|
-
* Enable new cache.
|
|
2085
|
-
*/
|
|
2086
|
-
cache?: ExperimentCacheOptions;
|
|
2087
|
-
/**
|
|
2088
|
-
* Enable lazy compilation.
|
|
2089
|
-
* @deprecated Please use the configuration top-level `lazyCompilation` option instead.
|
|
2090
|
-
* @default false
|
|
2091
|
-
*/
|
|
2092
|
-
lazyCompilation?: boolean | LazyCompilationOptions;
|
|
2093
2064
|
/**
|
|
2094
2065
|
* Enable async WebAssembly.
|
|
2095
2066
|
* Support the new WebAssembly according to the [updated specification](https://github.com/WebAssembly/esm-integration), it makes a WebAssembly module an async module.
|
|
@@ -2101,12 +2072,6 @@ export type Experiments = {
|
|
|
2101
2072
|
* @default false
|
|
2102
2073
|
*/
|
|
2103
2074
|
outputModule?: boolean;
|
|
2104
|
-
/**
|
|
2105
|
-
* Enable top-level await.
|
|
2106
|
-
* @deprecated This option is deprecated, top-level await is enabled by default.
|
|
2107
|
-
* @default true
|
|
2108
|
-
*/
|
|
2109
|
-
topLevelAwait?: boolean;
|
|
2110
2075
|
/**
|
|
2111
2076
|
* Enable CSS support.
|
|
2112
2077
|
*
|
|
@@ -2120,12 +2085,6 @@ export type Experiments = {
|
|
|
2120
2085
|
* - `module.generator["css/module"]`
|
|
2121
2086
|
*/
|
|
2122
2087
|
css?: boolean;
|
|
2123
|
-
/**
|
|
2124
|
-
* Enable module layers feature.
|
|
2125
|
-
* @deprecated This option is deprecated, layers is enabled since v1.6.0
|
|
2126
|
-
* @default false
|
|
2127
|
-
*/
|
|
2128
|
-
layers?: boolean;
|
|
2129
2088
|
/**
|
|
2130
2089
|
* Enable incremental builds.
|
|
2131
2090
|
*/
|
|
@@ -2135,20 +2094,11 @@ export type Experiments = {
|
|
|
2135
2094
|
* @default false
|
|
2136
2095
|
*/
|
|
2137
2096
|
futureDefaults?: boolean;
|
|
2138
|
-
/**
|
|
2139
|
-
* Enable future Rspack features default options.
|
|
2140
|
-
*/
|
|
2141
|
-
rspackFuture?: RspackFutureOptions;
|
|
2142
2097
|
/**
|
|
2143
2098
|
* Enable loading of modules via HTTP/HTTPS requests.
|
|
2144
2099
|
* @default false
|
|
2145
2100
|
*/
|
|
2146
2101
|
buildHttp?: HttpUriOptions;
|
|
2147
|
-
/**
|
|
2148
|
-
* Enable parallel loader
|
|
2149
|
-
* @default false
|
|
2150
|
-
*/
|
|
2151
|
-
parallelLoader?: boolean;
|
|
2152
2102
|
/**
|
|
2153
2103
|
* Enable Node.js input file system
|
|
2154
2104
|
* @default false
|
|
@@ -2159,30 +2109,6 @@ export type Experiments = {
|
|
|
2159
2109
|
* @default false
|
|
2160
2110
|
*/
|
|
2161
2111
|
nativeWatcher?: boolean;
|
|
2162
|
-
/**
|
|
2163
|
-
* Enable inline const feature
|
|
2164
|
-
* @default false
|
|
2165
|
-
* @deprecated This option is deprecated, it's already stable and enabled by default, Rspack will remove this option in future version
|
|
2166
|
-
*/
|
|
2167
|
-
inlineConst?: boolean;
|
|
2168
|
-
/**
|
|
2169
|
-
* Enable inline enum feature
|
|
2170
|
-
* @default false
|
|
2171
|
-
* @deprecated This option is deprecated, it's already stable. Rspack will remove this option in future version
|
|
2172
|
-
*/
|
|
2173
|
-
inlineEnum?: boolean;
|
|
2174
|
-
/**
|
|
2175
|
-
* Enable type reexports presence feature
|
|
2176
|
-
* @default false
|
|
2177
|
-
* @deprecated This option is deprecated, it's already stable. Rspack will remove this option in future version
|
|
2178
|
-
*/
|
|
2179
|
-
typeReexportsPresence?: boolean;
|
|
2180
|
-
/**
|
|
2181
|
-
* Enable lazy make side effects free barrel file
|
|
2182
|
-
* @default false
|
|
2183
|
-
* @deprecated This option is deprecated, it's already stable and enabled by default, Rspack will remove this option in future version
|
|
2184
|
-
*/
|
|
2185
|
-
lazyBarrel?: boolean;
|
|
2186
2112
|
/**
|
|
2187
2113
|
* Enable defer import feature
|
|
2188
2114
|
* @default false
|
|
@@ -2239,10 +2165,6 @@ export type IgnoreWarnings = (RegExp | {
|
|
|
2239
2165
|
*/
|
|
2240
2166
|
module?: RegExp;
|
|
2241
2167
|
} | ((warning: WebpackError, compilation: Compilation) => boolean))[];
|
|
2242
|
-
/**
|
|
2243
|
-
* Capture a "profile" of the application, including statistics and hints, which can then be dissected using the Analyze tool.
|
|
2244
|
-
* */
|
|
2245
|
-
export type Profile = boolean;
|
|
2246
2168
|
/**
|
|
2247
2169
|
* Set the value of `require.amd` and `define.amd`. Or disable AMD support.
|
|
2248
2170
|
*/
|
|
@@ -2398,10 +2320,6 @@ export type RspackOptions = {
|
|
|
2398
2320
|
* Options for module configuration.
|
|
2399
2321
|
*/
|
|
2400
2322
|
module?: ModuleOptions;
|
|
2401
|
-
/**
|
|
2402
|
-
* Whether to capture a profile of the application.
|
|
2403
|
-
*/
|
|
2404
|
-
profile?: Profile;
|
|
2405
2323
|
/**
|
|
2406
2324
|
* Set the value of `require.amd` or `define.amd`.
|
|
2407
2325
|
* Setting `amd` to false will disable rspack's AMD support.
|