@ohos-ports/rspack-core 2.2.2-beta.0 → 2.3.2-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/README.md +9 -0
- package/compiled/@rspack/lite-tapable/dist/index.d.ts +20 -6
- package/compiled/@rspack/lite-tapable/package.json +1 -1
- package/compiled/http-proxy-middleware/index.d.ts +10 -10
- package/compiled/http-proxy-middleware/package.json +1 -1
- package/compiled/open/package.json +1 -1
- package/compiled/tinypool/README.md +4 -4
- package/compiled/tinypool/dist/index.d.ts +3 -2
- package/compiled/tinypool/dist/index.js +3 -3
- package/compiled/tinypool/package.json +1 -1
- package/compiled/watchpack/index.js +276 -49
- package/compiled/watchpack/package.json +1 -1
- package/compiled/watchpack/types/DirectoryWatcher.d.ts +24 -0
- package/compiled/watchpack/types/index.d.ts +1 -1
- package/compiled/watchpack/types/watchEventSource.d.ts +9 -0
- package/compiled/webpack-sources/index.d.ts +61 -0
- package/compiled/webpack-sources/index.js +858 -224
- package/compiled/webpack-sources/package.json +8 -1
- package/compiled/webpack-sources/types/CachedSource.d.ts +192 -0
- package/compiled/webpack-sources/types/CompatSource.d.ts +87 -0
- package/compiled/webpack-sources/types/ConcatSource.d.ts +75 -0
- package/compiled/webpack-sources/types/OriginalSource.d.ts +87 -0
- package/compiled/webpack-sources/types/PrefixSource.d.ts +59 -0
- package/compiled/webpack-sources/types/RawSource.d.ts +75 -0
- package/compiled/webpack-sources/types/ReplaceSource.d.ts +107 -0
- package/compiled/webpack-sources/types/SizeOnlySource.d.ts +24 -0
- package/compiled/webpack-sources/types/Source.d.ts +189 -0
- package/compiled/webpack-sources/types/SourceMapSource.d.ts +136 -0
- package/compiled/webpack-sources/types/helpers/createMappingsSerializer.d.ts +60 -0
- package/compiled/webpack-sources/types/helpers/getFromStreamChunks.d.ts +16 -0
- package/compiled/webpack-sources/types/helpers/getGeneratedSourceInfo.d.ts +31 -0
- package/compiled/webpack-sources/types/helpers/getName.d.ts +15 -0
- package/compiled/webpack-sources/types/helpers/getSource.d.ts +15 -0
- package/compiled/webpack-sources/types/helpers/readMappings.d.ts +19 -0
- package/compiled/webpack-sources/types/helpers/scopes.d.ts +119 -0
- package/compiled/webpack-sources/types/helpers/splitIntoLines.d.ts +6 -0
- package/compiled/webpack-sources/types/helpers/splitIntoPotentialTokens.d.ts +37 -0
- package/compiled/webpack-sources/types/helpers/streamAndGetSourceAndMap.d.ts +39 -0
- package/compiled/webpack-sources/types/helpers/streamChunks.d.ts +56 -0
- package/compiled/webpack-sources/types/helpers/streamChunksOfCombinedSourceMap.d.ts +42 -0
- package/compiled/webpack-sources/types/helpers/streamChunksOfRawSource.d.ts +16 -0
- package/compiled/webpack-sources/types/helpers/streamChunksOfSourceMap.d.ts +19 -0
- package/compiled/webpack-sources/types/helpers/stringBufferUtils.d.ts +55 -0
- package/compiled/webpack-sources/types/index.d.ts +50 -0
- package/dist/BuildInfo.d.ts +13 -4
- package/dist/Chunk.d.ts +3 -3
- package/dist/ChunkGraph.d.ts +2 -2
- package/dist/Chunks.d.ts +2 -2
- package/dist/CodeGenerationResults.d.ts +6 -1
- package/dist/Compilation.d.ts +16 -53
- package/dist/Compiler.d.ts +9 -10
- package/dist/ConcatenatedModule.d.ts +5 -1
- package/dist/ContextModule.d.ts +3 -1
- package/dist/Diagnostics.d.ts +2 -6
- package/dist/Entrypoint.d.ts +1 -1
- package/dist/ExportsInfo.d.ts +1 -1
- package/dist/ExternalModule.d.ts +7 -6
- package/dist/FileSystem.d.ts +3 -1
- package/dist/FileSystemDependencies.d.ts +15 -0
- package/dist/FileSystemInfo.d.ts +1 -0
- package/dist/Module.d.ts +19 -11
- package/dist/ModuleGraph.d.ts +6 -6
- package/dist/ModuleGraphConnection.d.ts +9 -3
- package/dist/Modules.d.ts +3 -0
- package/dist/NativeWatchFileSystem.d.ts +20 -8
- package/dist/NormalModule.d.ts +14 -6
- package/dist/NormalModuleFactory.d.ts +2 -1
- package/dist/Resolver.d.ts +10 -2
- package/dist/ResolverFactory.d.ts +1 -1
- package/dist/RspackError.d.ts +2 -2
- package/dist/RuntimeGlobals.d.ts +4 -3
- package/dist/RuntimeModule.d.ts +1 -1
- package/dist/RuntimeTemplate.d.ts +1 -0
- package/dist/Stats.d.ts +1 -1
- package/dist/builtin-loader/lightningcss/target.d.ts +1 -1
- package/dist/builtin-plugin/APIPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ArrayPushCallbackChunkFormatPlugin.d.ts +1 -1
- package/dist/builtin-plugin/AssetModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/AsyncWebAssemblyModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/BannerPlugin.d.ts +2 -2
- package/dist/builtin-plugin/BundlerInfoRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CaseSensitivePlugin.d.ts +1 -1
- package/dist/builtin-plugin/ChunkPrefetchPreloadPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CircularCheckRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CircularDependencyRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CircularModulesInfoPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CommonJsChunkFormatPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CompactHashedChunkIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CompactHashedModuleIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ContextReplacementPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CopyRspackPlugin.d.ts +2 -2
- package/dist/builtin-plugin/CssChunkingPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CssHttpExternalsRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CssModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DataUriPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DefinePlugin.d.ts +1 -1
- package/dist/builtin-plugin/DeterministicChunkIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DeterministicModuleIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DllEntryPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DllReferenceAgencyPlugin.d.ts +2 -2
- package/dist/builtin-plugin/DynamicEntryPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ElectronTargetPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EnableChunkLoadingPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EnableLibraryPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EnableWasmLoadingPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EnsureChunkConditionsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EntryPlugin.d.ts +2 -2
- package/dist/builtin-plugin/EsmNodeTargetPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EvalDevToolModulePlugin.d.ts +2 -2
- package/dist/builtin-plugin/EvalSourceMapDevToolPlugin.d.ts +5 -4
- package/dist/builtin-plugin/ExternalsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/FetchCompileAsyncWasmPlugin.d.ts +1 -1
- package/dist/builtin-plugin/FileUriPlugin.d.ts +1 -1
- package/dist/builtin-plugin/FlagAllModulesAsUsedPlugin.d.ts +1 -1
- package/dist/builtin-plugin/FlagDependencyExportsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/FlagDependencyUsagePlugin.d.ts +1 -1
- package/dist/builtin-plugin/HashedModuleIdsPlugin.d.ts +2 -2
- package/dist/builtin-plugin/HotModuleReplacementPlugin.d.ts +1 -1
- package/dist/builtin-plugin/HttpExternalsRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/HttpUriPlugin.d.ts +5 -1
- package/dist/builtin-plugin/IgnorePlugin.d.ts +2 -2
- package/dist/builtin-plugin/ImportedByDeferModulesPlugin.d.ts +9 -0
- package/dist/builtin-plugin/InferAsyncModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/InlineExportsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/JavascriptModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/JsLoaderRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/JsonModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/LibManifestPlugin.d.ts +1 -1
- package/dist/builtin-plugin/LightningCssMinimizerRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/LimitChunkCountPlugin.d.ts +1 -1
- package/dist/builtin-plugin/MangleExportsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/MergeDuplicateChunksPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ModuleChunkFormatPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ModuleConcatenationPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ModuleInfoHeaderPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NamedChunkIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NamedModuleIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NaturalChunkIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NaturalModuleIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NoEmitOnErrorsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NodeTargetPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NormalModuleReplacementPlugin.d.ts +1 -1
- package/dist/builtin-plugin/OccurrenceChunkIdsPlugin.d.ts +2 -2
- package/dist/builtin-plugin/ProgressPlugin.d.ts +2 -2
- package/dist/builtin-plugin/ProvidePlugin.d.ts +1 -1
- package/dist/builtin-plugin/RealContentHashPlugin.d.ts +1 -1
- package/dist/builtin-plugin/RemoveDuplicateModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/RemoveEmptyChunksPlugin.d.ts +1 -1
- package/dist/builtin-plugin/RsdoctorPlugin.d.ts +2 -2
- package/dist/builtin-plugin/RslibPlugin.d.ts +4 -4
- package/dist/builtin-plugin/RstestPlugin.d.ts +2 -2
- package/dist/builtin-plugin/RuntimeChunkPlugin.d.ts +2 -2
- package/dist/builtin-plugin/RuntimePlugin.d.ts +1 -1
- package/dist/builtin-plugin/SideEffectsFlagPlugin.d.ts +1 -1
- package/dist/builtin-plugin/SizeLimitsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/SourceMapDevToolPlugin.d.ts +2 -2
- package/dist/builtin-plugin/SplitChunksPlugin.d.ts +1 -1
- package/dist/builtin-plugin/SubresourceIntegrityPlugin.d.ts +3 -2
- package/dist/builtin-plugin/SwcJsMinimizerPlugin.d.ts +1 -1
- package/dist/builtin-plugin/SyncModuleIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/URLPlugin.d.ts +1 -1
- package/dist/builtin-plugin/WorkerPlugin.d.ts +1 -1
- package/dist/builtin-plugin/base.d.ts +1 -1
- package/dist/builtin-plugin/css-extract/index.d.ts +1 -1
- package/dist/builtin-plugin/css-extract/utils.d.ts +4 -1
- package/dist/builtin-plugin/html-plugin/hooks.d.ts +1 -1
- package/dist/builtin-plugin/html-plugin/plugin.d.ts +2 -2
- package/dist/builtin-plugin/index.d.ts +1 -0
- package/dist/builtin-plugin/lazy-compilation/lazyCompilation.d.ts +3 -3
- package/dist/builtin-plugin/rsc/RscClientPlugin.d.ts +1 -1
- package/dist/builtin-plugin/rsc/RscServerPlugin.d.ts +1 -1
- package/dist/config/adapter.d.ts +1 -1
- package/dist/config/adapterRuleUse.d.ts +3 -2
- package/dist/config/normalization.d.ts +5 -8
- package/dist/config/target.d.ts +2 -0
- package/dist/config/types.d.ts +104 -19
- package/dist/container/ContainerPlugin.d.ts +1 -1
- package/dist/container/ContainerReferencePlugin.d.ts +1 -1
- package/dist/container/ModuleFederationManifestPlugin.d.ts +1 -1
- package/dist/container/ModuleFederationPluginV1.d.ts +5 -1
- package/dist/container/ModuleFederationRuntimePlugin.d.ts +1 -1
- package/dist/cssExtractHmr.js +1 -1
- package/dist/cssExtractLoader.js +7 -5
- package/dist/exports.d.ts +7 -7
- package/dist/index.js +1845 -1070
- package/dist/lib/Cache.d.ts +3 -0
- package/dist/lib/DllReferencePlugin.d.ts +1 -1
- package/dist/lib/WebpackError.d.ts +1 -1
- package/dist/loader-runner/codeFilter.d.ts +9 -0
- package/dist/loader-runner/dependencies.d.ts +5 -4
- package/dist/loader-runner/index.d.ts +3 -2
- package/dist/loader-runner/service.d.ts +6 -5
- package/dist/loader-runner/worker.d.ts +5 -2
- package/dist/l~0.js +34 -0
- package/dist/l~3.js +34 -0
- package/dist/node/NodeWatchFileSystem.d.ts +7 -4
- package/dist/sharing/CollectSharedEntryPlugin.d.ts +1 -1
- package/dist/sharing/ConsumeSharedPlugin.d.ts +1 -1
- package/dist/sharing/ProvideSharedPlugin.d.ts +1 -1
- package/dist/sharing/SharePlugin.d.ts +13 -1
- package/dist/sharing/ShareRuntimePlugin.d.ts +1 -1
- package/dist/sharing/SharedContainerPlugin.d.ts +1 -1
- package/dist/sharing/SharedUsedExportsOptimizerPlugin.d.ts +2 -2
- package/dist/sources.d.ts +3 -0
- package/dist/stats/StatsFactory.d.ts +4 -2
- package/dist/stats/StatsPrinter.d.ts +5 -5
- package/dist/stats/statsFactoryUtils.d.ts +12 -6
- package/dist/swc.d.ts +1 -1
- package/dist/taps/compilation.d.ts +1 -1
- package/dist/taps/types.d.ts +1 -1
- package/dist/util/SplitChunkSize.d.ts +1 -1
- package/dist/util/bindingHelpers.d.ts +9 -0
- package/dist/util/createModule.d.ts +3 -0
- package/dist/util/fs.d.ts +22 -16
- package/dist/util/resolveLayerExternals.d.ts +1 -0
- package/dist/util/source.d.ts +13 -4
- package/dist/util/symbols.d.ts +10 -0
- package/dist/util/watchTimeInfo.d.ts +11 -0
- package/dist/worker.js +386 -353
- package/hot/lazy-compilation-node.js +1 -1
- package/hot/lazy-compilation-web.js +1 -1
- package/package.json +8 -32
- package/compiled/webpack-sources/types.d.ts +0 -500
- package/dist/612~0.js +0 -32
- package/dist/612~3.js +0 -32
- package/dist/loader-runner/cache.d.ts +0 -18
- package/dist/util/MergeCaller.d.ts +0 -10
- package/dist/util/fake.d.ts +0 -11
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type BuiltinPlugin, BuiltinPluginName, type RawSplitChunksOptions } from '@
|
|
1
|
+
import { type BuiltinPlugin, BuiltinPluginName, type RawSplitChunksOptions } from '@rspack/binding';
|
|
2
2
|
import type { Compiler } from '../Compiler.js';
|
|
3
3
|
import type { OptimizationSplitChunksOptions } from '../config/index.js';
|
|
4
4
|
import { RspackBuiltinPlugin } from './base.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type RawSubresourceIntegrityPluginOptions } from '@
|
|
1
|
+
import { type RawSubresourceIntegrityPluginOptions } from '@rspack/binding';
|
|
2
2
|
import type { Compiler } from '../Compiler.js';
|
|
3
3
|
export type SubresourceIntegrityHashFunction = 'sha256' | 'sha384' | 'sha512';
|
|
4
4
|
export type SubresourceIntegrityPluginOptions = {
|
|
@@ -8,6 +8,7 @@ export type SubresourceIntegrityPluginOptions = {
|
|
|
8
8
|
];
|
|
9
9
|
htmlPlugin?: string | false;
|
|
10
10
|
enabled?: 'auto' | boolean;
|
|
11
|
+
hashLoading?: 'eager' | 'lazy';
|
|
11
12
|
};
|
|
12
13
|
export type NativeSubresourceIntegrityPluginOptions = Omit<RawSubresourceIntegrityPluginOptions, 'htmlPlugin'> & {
|
|
13
14
|
htmlPlugin: string | false;
|
|
@@ -21,7 +22,7 @@ declare const NativeSubresourceIntegrityPlugin: {
|
|
|
21
22
|
name: string;
|
|
22
23
|
_args: [options: NativeSubresourceIntegrityPluginOptions];
|
|
23
24
|
affectedHooks: keyof import("../index.js").CompilerHooks | undefined;
|
|
24
|
-
raw(compiler: Compiler): import("@
|
|
25
|
+
raw(compiler: Compiler): import("@rspack/binding").BuiltinPlugin;
|
|
25
26
|
apply(compiler: Compiler): void;
|
|
26
27
|
};
|
|
27
28
|
};
|
|
@@ -209,7 +209,7 @@ export declare const SwcJsMinimizerRspackPlugin: {
|
|
|
209
209
|
name: string;
|
|
210
210
|
_args: [options?: SwcJsMinimizerRspackPluginOptions | undefined];
|
|
211
211
|
affectedHooks: keyof import("../index.js").CompilerHooks | undefined;
|
|
212
|
-
raw(compiler: Compiler): import("@
|
|
212
|
+
raw(compiler: Compiler): import("@rspack/binding").BuiltinPlugin;
|
|
213
213
|
apply(compiler: Compiler): void;
|
|
214
214
|
};
|
|
215
215
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type BuiltinPlugin, BuiltinPluginName } from '@
|
|
1
|
+
import { type BuiltinPlugin, BuiltinPluginName } from '@rspack/binding';
|
|
2
2
|
import type { Module } from '../Module.js';
|
|
3
3
|
import { RspackBuiltinPlugin } from './base.js';
|
|
4
4
|
export interface SyncModuleIdsPluginOptions {
|
|
@@ -3,7 +3,7 @@ export declare const URLPlugin: {
|
|
|
3
3
|
name: string;
|
|
4
4
|
_args: [];
|
|
5
5
|
affectedHooks: keyof import("../index.js").CompilerHooks | undefined;
|
|
6
|
-
raw(compiler: import("../index.js").Compiler): import("@
|
|
6
|
+
raw(compiler: import("../index.js").Compiler): import("@rspack/binding").BuiltinPlugin;
|
|
7
7
|
apply(compiler: import("../index.js").Compiler): void;
|
|
8
8
|
};
|
|
9
9
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type BuiltinPlugin, BuiltinPluginName } from '@
|
|
1
|
+
import { type BuiltinPlugin, BuiltinPluginName } from '@rspack/binding';
|
|
2
2
|
import type { Compiler } from '../Compiler.js';
|
|
3
3
|
import type { ChunkLoading, OutputModule, WasmLoading, WorkerPublicPath } from '../config/index.js';
|
|
4
4
|
import { RspackBuiltinPlugin } from './base.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import binding from '@
|
|
1
|
+
import binding from '@rspack/binding';
|
|
2
2
|
import type { Compiler, RspackPluginInstance } from '../index.js';
|
|
3
3
|
type AffectedHooks = keyof Compiler['hooks'];
|
|
4
4
|
export declare function canInherentFromParent(affectedHooks?: AffectedHooks): boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type RawCssExtractPluginOption } from '@
|
|
1
|
+
import { type RawCssExtractPluginOption } from '@rspack/binding';
|
|
2
2
|
import type { Compiler, LiteralUnion } from '../../index.js';
|
|
3
3
|
export * from './loader.js';
|
|
4
4
|
export type { CssExtractRspackLoaderOptions } from './loader.js';
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import type { LoaderContext } from '../../index.js';
|
|
2
2
|
export declare function isAbsolutePath(str: string): boolean;
|
|
3
3
|
export declare const PLUGIN_NAME = "css-extract-rspack-plugin";
|
|
4
|
-
export declare const pluginSymbol: symbol;
|
|
4
|
+
export declare const pluginSymbol: unique symbol;
|
|
5
5
|
export interface CssExtractPluginData {
|
|
6
6
|
runtime: boolean;
|
|
7
7
|
}
|
|
8
|
+
export interface CssExtractPluginContext {
|
|
9
|
+
[pluginSymbol]?: CssExtractPluginData;
|
|
10
|
+
}
|
|
8
11
|
export declare function isRelativePath(str: string): boolean;
|
|
9
12
|
export declare function stringifyRequest(loaderContext: LoaderContext, request: string): string;
|
|
10
13
|
export declare function stringifyLocal(value: any): any;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { JsAfterEmitData, JsAfterTemplateExecutionData, JsAlterAssetTagGroupsData, JsAlterAssetTagsData, JsBeforeAssetTagGenerationData, JsBeforeEmitData } from '@
|
|
1
|
+
import type { JsAfterEmitData, JsAfterTemplateExecutionData, JsAlterAssetTagGroupsData, JsAlterAssetTagsData, JsBeforeAssetTagGenerationData, JsBeforeEmitData } from '@rspack/binding';
|
|
2
2
|
import * as liteTapable from '../../../compiled/@rspack/lite-tapable/dist/index.js';
|
|
3
3
|
import { type Compilation } from '../../Compilation.js';
|
|
4
4
|
import type { HtmlRspackPluginOptions } from './options.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type JsHtmlPluginTag } from '@
|
|
1
|
+
import { type JsHtmlPluginTag } from '@rspack/binding';
|
|
2
2
|
import type { Compilation } from '../../Compilation.js';
|
|
3
3
|
import type { Compiler } from '../../Compiler.js';
|
|
4
4
|
import { type HtmlRspackPluginHooks } from './hooks.js';
|
|
@@ -8,7 +8,7 @@ declare const HtmlRspackPluginImpl: {
|
|
|
8
8
|
name: string;
|
|
9
9
|
_args: [c?: HtmlRspackPluginOptions | undefined];
|
|
10
10
|
affectedHooks: keyof import("../../index.js").CompilerHooks | undefined;
|
|
11
|
-
raw(compiler: Compiler): import("@
|
|
11
|
+
raw(compiler: Compiler): import("@rspack/binding").BuiltinPlugin;
|
|
12
12
|
apply(compiler: Compiler): void;
|
|
13
13
|
};
|
|
14
14
|
};
|
|
@@ -48,6 +48,7 @@ export * from './HttpUriPlugin.js';
|
|
|
48
48
|
export * from './html-plugin/index.js';
|
|
49
49
|
export * from './IgnorePlugin.js';
|
|
50
50
|
export * from './InferAsyncModulesPlugin.js';
|
|
51
|
+
export * from './ImportedByDeferModulesPlugin.js';
|
|
51
52
|
export * from './InlineExportsPlugin.js';
|
|
52
53
|
export * from './JavascriptModulesPlugin.js';
|
|
53
54
|
export * from './JsLoaderRspackPlugin.js';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { Module } from '../../Module.js';
|
|
2
2
|
export declare const BuiltinLazyCompilationPlugin: {
|
|
3
|
-
new (
|
|
3
|
+
new (takeNewlyActiveModules: () => Set<string>, entries: boolean, imports: boolean, client: string, collectReservedExternals: (layer?: string | null) => string[], test?: RegExp | ((module: Module) => boolean) | undefined): {
|
|
4
4
|
name: string;
|
|
5
|
-
_args: [
|
|
5
|
+
_args: [takeNewlyActiveModules: () => Set<string>, entries: boolean, imports: boolean, client: string, collectReservedExternals: (layer?: string | null) => string[], test?: RegExp | ((module: Module) => boolean) | undefined];
|
|
6
6
|
affectedHooks: keyof import("../../index.js").CompilerHooks | undefined;
|
|
7
|
-
raw(compiler: import("../../index.js").Compiler): import("@
|
|
7
|
+
raw(compiler: import("../../index.js").Compiler): import("@rspack/binding").BuiltinPlugin;
|
|
8
8
|
apply(compiler: import("../../index.js").Compiler): void;
|
|
9
9
|
};
|
|
10
10
|
};
|
package/dist/config/adapter.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type RawOptions } from '@
|
|
1
|
+
import { type RawOptions } from '@rspack/binding';
|
|
2
2
|
import type { Compiler } from '../Compiler.js';
|
|
3
3
|
import { type LoaderContext, type LoaderDefinition, type LoaderDefinitionFunction, type PitchLoaderDefinitionFunction } from './adapterRuleUse.js';
|
|
4
4
|
import type { RspackOptionsNormalized } from './normalization.js';
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import type { AssetInfo, RawModuleRuleUse, RawOptions } from '@
|
|
1
|
+
import type { AssetInfo, RawModuleRuleUse, RawOptions } from '@rspack/binding';
|
|
2
2
|
import type { Compilation } from '../Compilation.js';
|
|
3
3
|
import type { Compiler } from '../Compiler.js';
|
|
4
4
|
import type { LoaderObject } from '../loader-runner/index.js';
|
|
5
5
|
import type { Logger } from '../logging/Logger.js';
|
|
6
6
|
import type { Module } from '../Module.js';
|
|
7
7
|
import type { ResolveRequest } from '../Resolver.js';
|
|
8
|
+
import type { InputFileSystem } from '../util/fs.js';
|
|
8
9
|
import type Hash from '../util/hash/index.js';
|
|
9
10
|
import type { RspackOptionsNormalized } from './normalization.js';
|
|
10
11
|
import type { Environment, Mode, PublicPath, Resolve, RuleSetLoaderWithOptions, RuleSetUseItem, Target } from './types.js';
|
|
@@ -333,7 +334,7 @@ export interface LoaderContext<OptionsType = {}> {
|
|
|
333
334
|
/**
|
|
334
335
|
* Access to the `compilation` object's `inputFileSystem` property.
|
|
335
336
|
*/
|
|
336
|
-
fs:
|
|
337
|
+
fs: InputFileSystem;
|
|
337
338
|
/**
|
|
338
339
|
* This is an experimental API and maybe subject to change.
|
|
339
340
|
* @experimental
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
import type { HttpUriPluginOptions } from '../builtin-plugin/index.js';
|
|
11
11
|
import type { Compilation } from '../Compilation.js';
|
|
12
12
|
import type WebpackError from '../lib/WebpackError.js';
|
|
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, NewCache, Name, Node, NoParseOption, Optimization, OutputModule, ParserOptionsByModuleType, Path, Performance, Plugins, PublicPath, Resolve, RspackOptions, RuleSetRules, ScriptType, SourceMapFilename, StatsValue, StrictModuleErrorHandling, Target, TrustedTypes, UniqueName, WasmLoading, WasmStreamingFallback, Watch, WatchOptions, WebassemblyModuleFilename, WorkerPublicPath } from './types.js';
|
|
13
|
+
import type { Amd, AssetModuleFilename, Bail, BundlerInfoOptions, SnapshotOptions, 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, NewCache, Name, Node, NoParseOption, Optimization, OutputModule, ParserOptionsByModuleType, Path, Performance, Plugins, PublicPath, Resolve, RspackOptions, RuleSetRules, ScriptType, SourceMapFilename, StatsValue, StrictModuleErrorHandling, Target, TrustedTypes, UniqueName, WasmLoading, WasmStreamingFallback, Watch, WatchOptions, WebassemblyModuleFilename, WorkerPublicPath } from './types.js';
|
|
14
14
|
export declare const getNormalizedRspackOptions: (config: RspackOptions) => RspackOptionsNormalized;
|
|
15
15
|
export type EntryDynamicNormalized = () => Promise<EntryStaticNormalized>;
|
|
16
16
|
export type EntryNormalized = EntryDynamicNormalized | EntryStaticNormalized;
|
|
@@ -78,22 +78,18 @@ export interface ModuleOptionsNormalized {
|
|
|
78
78
|
generator: GeneratorOptionsByModuleType;
|
|
79
79
|
noParse?: NoParseOption;
|
|
80
80
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
unmanagedPaths?: (string | RegExp)[];
|
|
84
|
-
managedPaths?: (string | RegExp)[];
|
|
85
|
-
};
|
|
81
|
+
/** @deprecated Use the top-level `snapshot` option. */
|
|
82
|
+
export type CacheSnapshotNormalized = SnapshotOptions;
|
|
86
83
|
export type CacheNormalized = false | {
|
|
87
84
|
type: 'memory';
|
|
88
|
-
snapshot: CacheSnapshotNormalized;
|
|
89
85
|
} | {
|
|
90
86
|
type: 'persistent';
|
|
91
87
|
name?: string;
|
|
92
88
|
buildDependencies: string[];
|
|
93
89
|
version?: string;
|
|
94
90
|
maxAge?: number;
|
|
91
|
+
maxMemoryGenerations?: number;
|
|
95
92
|
maxVersions?: number;
|
|
96
|
-
snapshot: CacheSnapshotNormalized;
|
|
97
93
|
storage: {
|
|
98
94
|
type: 'filesystem';
|
|
99
95
|
directory?: string;
|
|
@@ -140,6 +136,7 @@ export interface RspackOptionsNormalized {
|
|
|
140
136
|
node: Node;
|
|
141
137
|
loader: Loader;
|
|
142
138
|
cache?: CacheNormalized;
|
|
139
|
+
snapshot: SnapshotOptions;
|
|
143
140
|
stats: StatsValue;
|
|
144
141
|
optimization: Optimization;
|
|
145
142
|
plugins: Plugins;
|
package/dist/config/target.d.ts
CHANGED
|
@@ -85,6 +85,8 @@ export type EcmaTargetProperties = {
|
|
|
85
85
|
templateLiteral: boolean | null;
|
|
86
86
|
/** async functions and await are available */
|
|
87
87
|
asyncFunction: boolean | null;
|
|
88
|
+
/** top-level await is available */
|
|
89
|
+
topLevelAwait: boolean | null;
|
|
88
90
|
};
|
|
89
91
|
export type ExtractedTargetProperties = {
|
|
90
92
|
esVersion?: number | null;
|
package/dist/config/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AssetInfo, RawFuncUseCtx } from '@
|
|
1
|
+
import type { AssetInfo, RawFuncUseCtx } from '@rspack/binding';
|
|
2
2
|
import type { HttpUriPluginOptions } from '../builtin-plugin/HttpUriPlugin.js';
|
|
3
3
|
import type { ChunkGraph } from '../ChunkGraph.js';
|
|
4
4
|
import type { Compilation, PathData } from '../Compilation.js';
|
|
@@ -301,6 +301,8 @@ export type Environment = {
|
|
|
301
301
|
logicalAssignment?: boolean;
|
|
302
302
|
/** The environment supports template literals. */
|
|
303
303
|
templateLiteral?: boolean;
|
|
304
|
+
/** The environment supports top-level await ('await x' at the top level of a module). */
|
|
305
|
+
topLevelAwait?: boolean;
|
|
304
306
|
};
|
|
305
307
|
export type Output = {
|
|
306
308
|
/**
|
|
@@ -617,7 +619,7 @@ export type ResolveOptions = {
|
|
|
617
619
|
* A list of resolve restrictions to restrict the paths that a request can be resolved on.
|
|
618
620
|
* @default []
|
|
619
621
|
* */
|
|
620
|
-
restrictions?: string[];
|
|
622
|
+
restrictions?: (string | RegExp)[];
|
|
621
623
|
/**
|
|
622
624
|
* A list of directories where server-relative URLs (beginning with '/') are resolved.
|
|
623
625
|
* On systems other than Windows, these requests are initially resolved as an absolute path.
|
|
@@ -640,6 +642,7 @@ export type RuleSetLogicalConditions = {
|
|
|
640
642
|
};
|
|
641
643
|
export type RuleSetLoader = string;
|
|
642
644
|
export type RuleSetLoaderOptions = string | Record<string, any>;
|
|
645
|
+
export type RuleSetLoaderCodeFilter = string | RegExp;
|
|
643
646
|
export type RuleSetLoaderWithOptions = {
|
|
644
647
|
/**
|
|
645
648
|
* Stable identifier used to reference object-form loader options.
|
|
@@ -665,10 +668,15 @@ export type RuleSetLoaderWithOptions = {
|
|
|
665
668
|
* @experimental
|
|
666
669
|
*/
|
|
667
670
|
cache?: boolean;
|
|
671
|
+
/**
|
|
672
|
+
* Filters the current input before calling the normal loader handler.
|
|
673
|
+
* The loader pitch function is not filtered.
|
|
674
|
+
*/
|
|
675
|
+
codeFilter?: RuleSetLoaderCodeFilter;
|
|
668
676
|
options?: RuleSetLoaderOptions;
|
|
669
677
|
};
|
|
670
|
-
export type RuleSetUseItem = RuleSetLoader | RuleSetLoaderWithOptions;
|
|
671
|
-
export type RuleSetUse = RuleSetUseItem | RuleSetUseItem[] | ((data: RawFuncUseCtx) => RuleSetUseItem[]);
|
|
678
|
+
export type RuleSetUseItem = RuleSetLoader | RuleSetLoaderWithOptions | Falsy;
|
|
679
|
+
export type RuleSetUse = RuleSetUseItem | RuleSetUseItem[] | ((data: RawFuncUseCtx) => RuleSetUseItem | RuleSetUseItem[]);
|
|
672
680
|
export type RuleSetRuleUseAndLoader = {
|
|
673
681
|
/** A loader name */
|
|
674
682
|
loader: RuleSetLoader;
|
|
@@ -693,6 +701,13 @@ export type RuleSetRuleUseAndLoader = {
|
|
|
693
701
|
};
|
|
694
702
|
/** Rule defines the conditions for matching a module and the behavior of handling those modules. */
|
|
695
703
|
export type RuleSetRule = RuleSetRuleUseAndLoader & {
|
|
704
|
+
/**
|
|
705
|
+
* Create a resource for matching subsequent rules from a path template.
|
|
706
|
+
* `[resource-path]` expands to the current matching path, including its extension.
|
|
707
|
+
* Query and fragment are preserved. The original resource is used by loaders.
|
|
708
|
+
* @experimental
|
|
709
|
+
*/
|
|
710
|
+
as?: string;
|
|
696
711
|
/** Matches all modules that match this resource, and will match against Resource. */
|
|
697
712
|
test?: RuleSetCondition;
|
|
698
713
|
/** Excludes all modules that match this condition and will match against the absolute path of the resource */
|
|
@@ -1001,6 +1016,11 @@ export type JavascriptParserOptions = {
|
|
|
1001
1016
|
* @default true
|
|
1002
1017
|
* */
|
|
1003
1018
|
url?: 'relative' | 'new-url-relative' | boolean;
|
|
1019
|
+
/**
|
|
1020
|
+
* Enable parsing of dynamic requests in new URL().
|
|
1021
|
+
* @default true
|
|
1022
|
+
*/
|
|
1023
|
+
dynamicUrl?: boolean;
|
|
1004
1024
|
/**
|
|
1005
1025
|
* Enable warnings for full dynamic dependencies
|
|
1006
1026
|
* @default true
|
|
@@ -1210,6 +1230,14 @@ export type CssGeneratorOptions = {
|
|
|
1210
1230
|
* If false, generate stylesheets and embed them in the template.
|
|
1211
1231
|
*/
|
|
1212
1232
|
exportsOnly?: CssGeneratorExportsOnly;
|
|
1233
|
+
/**
|
|
1234
|
+
* Resolve asset URLs in injected styles against the runtime public path
|
|
1235
|
+
* (`import.meta.rspackPublicPath`) instead of the build-time `output.publicPath`.
|
|
1236
|
+
* Only applies when `parser.exportType` is "style". Assets with their own
|
|
1237
|
+
* `generator.publicPath` keep that value.
|
|
1238
|
+
* @default false
|
|
1239
|
+
*/
|
|
1240
|
+
runtimePublicPath?: boolean;
|
|
1213
1241
|
/** This configuration is available for improved ESM-CJS interoperability purposes. */
|
|
1214
1242
|
esModule?: CssGeneratorEsModule;
|
|
1215
1243
|
};
|
|
@@ -1225,6 +1253,14 @@ export type CssModuleGeneratorOptions = {
|
|
|
1225
1253
|
* If false, generate stylesheets and embed them in the template.
|
|
1226
1254
|
*/
|
|
1227
1255
|
exportsOnly?: CssGeneratorExportsOnly;
|
|
1256
|
+
/**
|
|
1257
|
+
* Resolve asset URLs in injected styles against the runtime public path
|
|
1258
|
+
* (`import.meta.rspackPublicPath`) instead of the build-time `output.publicPath`.
|
|
1259
|
+
* Only applies when `parser.exportType` is "style". Assets with their own
|
|
1260
|
+
* `generator.publicPath` keep that value.
|
|
1261
|
+
* @default false
|
|
1262
|
+
*/
|
|
1263
|
+
runtimePublicPath?: boolean;
|
|
1228
1264
|
/**
|
|
1229
1265
|
* Digest types used for the hash.
|
|
1230
1266
|
*/
|
|
@@ -1296,7 +1332,7 @@ export type ModuleOptions = {
|
|
|
1296
1332
|
/** Keep module mechanism of the matched modules as-is, such as module.exports, require, import. */
|
|
1297
1333
|
noParse?: NoParseOption;
|
|
1298
1334
|
};
|
|
1299
|
-
type AllowTarget = 'web' | 'webworker' | 'es3' | 'es5' | 'es2015' | 'es2016' | 'es2017' | 'es2018' | 'es2019' | 'es2020' | 'es2021' | 'es2022' | 'es2023' | 'es2024' | 'es2025' | '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}`;
|
|
1335
|
+
type AllowTarget = 'web' | 'webworker' | 'es3' | 'es5' | 'es2015' | 'es2016' | 'es2017' | 'es2018' | 'es2019' | 'es2020' | 'es2021' | 'es2022' | 'es2023' | 'es2024' | 'es2025' | 'es2026' | '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}`;
|
|
1300
1336
|
/** Used to configure the target environment of Rspack output and the ECMAScript version of Rspack runtime code. */
|
|
1301
1337
|
export type Target = false | AllowTarget | AllowTarget[];
|
|
1302
1338
|
/**
|
|
@@ -1304,7 +1340,7 @@ export type Target = false | AllowTarget | AllowTarget[];
|
|
|
1304
1340
|
* `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.
|
|
1305
1341
|
* @default 'var'
|
|
1306
1342
|
*/
|
|
1307
|
-
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' | 'modern-module' | 'script' | 'node-commonjs' | 'commonjs-import';
|
|
1343
|
+
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' | 'modern-module' | 'script' | 'node-commonjs' | 'commonjs-import' | 'asset' | 'asset-url' | 'css-import';
|
|
1308
1344
|
/**
|
|
1309
1345
|
* External item object when both library.type and externalsType is 'umd'
|
|
1310
1346
|
*/
|
|
@@ -1332,6 +1368,10 @@ export type ExternalItemValue = string | boolean | string[] | ExternalItemUmdVal
|
|
|
1332
1368
|
export type ExternalItemObjectUnknown = {
|
|
1333
1369
|
[x: string]: ExternalItemValue;
|
|
1334
1370
|
};
|
|
1371
|
+
export type ExternalItemObjectKnown = {
|
|
1372
|
+
/** Specify externals depending on the importing module's layer. */
|
|
1373
|
+
byLayer?: Record<string, ExternalItem> | ((layer: string | null) => ExternalItem | undefined);
|
|
1374
|
+
};
|
|
1335
1375
|
/**
|
|
1336
1376
|
* Data object passed as argument when a function is set for 'externals'.
|
|
1337
1377
|
*/
|
|
@@ -1345,8 +1385,9 @@ export type ExternalItemFunctionData = {
|
|
|
1345
1385
|
};
|
|
1346
1386
|
/**
|
|
1347
1387
|
* Get a resolve function with the current resolver options.
|
|
1388
|
+
* The returned function accepts a callback or returns a Promise when called without one.
|
|
1348
1389
|
*/
|
|
1349
|
-
getResolve?: (options?: ResolveOptions) => ((context: string, request: string, callback: ResolveCallback) => void)
|
|
1390
|
+
getResolve?: (options?: ResolveOptions) => ((context: string, request: string, callback: ResolveCallback) => void) & ((context: string, request: string) => Promise<string | undefined>);
|
|
1350
1391
|
};
|
|
1351
1392
|
/**
|
|
1352
1393
|
* Prevent bundling of certain imported package and instead retrieve these external dependencies at runtime.
|
|
@@ -1361,7 +1402,7 @@ export type ExternalItemFunctionData = {
|
|
|
1361
1402
|
* }
|
|
1362
1403
|
* ```
|
|
1363
1404
|
* */
|
|
1364
|
-
export type ExternalItem = string | RegExp |
|
|
1405
|
+
export type ExternalItem = string | RegExp | ExternalItemObjectKnown | ExternalItemObjectUnknown | ((data: ExternalItemFunctionData, callback: (err?: Error | null, result?: ExternalItemValue, type?: ExternalsType) => void) => ExternalItemValue | void | Promise<ExternalItemValue | void>);
|
|
1365
1406
|
/**
|
|
1366
1407
|
* Prevent bundling of certain imported packages and instead retrieve these external dependencies at runtime.
|
|
1367
1408
|
*
|
|
@@ -1488,7 +1529,7 @@ export type Loader = Record<string, any>;
|
|
|
1488
1529
|
/**
|
|
1489
1530
|
* Snapshot options for determining which files have been modified.
|
|
1490
1531
|
*/
|
|
1491
|
-
export type
|
|
1532
|
+
export type SnapshotOptions = {
|
|
1492
1533
|
/**
|
|
1493
1534
|
* An array of paths to immutable files, changes to these paths will be ignored during hot restart.
|
|
1494
1535
|
*/
|
|
@@ -1502,7 +1543,25 @@ export type CacheSnapshotOptions = {
|
|
|
1502
1543
|
* @default [/[\\/]node_modules[\\/][^.]/]
|
|
1503
1544
|
*/
|
|
1504
1545
|
managedPaths?: (string | RegExp)[];
|
|
1546
|
+
/** Snapshot strategy for build dependencies. */
|
|
1547
|
+
buildDependencies?: SnapshotStrategyOptions;
|
|
1548
|
+
/** Snapshot strategy for resolving build dependencies. */
|
|
1549
|
+
resolveBuildDependencies?: SnapshotStrategyOptions;
|
|
1550
|
+
/** Snapshot strategy for module dependencies. */
|
|
1551
|
+
module?: SnapshotStrategyOptions;
|
|
1552
|
+
/** Snapshot strategy for context modules. */
|
|
1553
|
+
contextModule?: SnapshotStrategyOptions;
|
|
1554
|
+
/** Snapshot strategy for resolving requests. */
|
|
1555
|
+
resolve?: SnapshotStrategyOptions;
|
|
1556
|
+
};
|
|
1557
|
+
export type SnapshotStrategyOptions = {
|
|
1558
|
+
/** Use content hashes to detect changes. */
|
|
1559
|
+
hash?: boolean;
|
|
1560
|
+
/** Use timestamps to detect changes. */
|
|
1561
|
+
timestamp?: boolean;
|
|
1505
1562
|
};
|
|
1563
|
+
/** @deprecated Use `SnapshotOptions` and the top-level `snapshot` option. */
|
|
1564
|
+
export type CacheSnapshotOptions = SnapshotOptions;
|
|
1506
1565
|
/**
|
|
1507
1566
|
* Storage options for persistent cache.
|
|
1508
1567
|
*/
|
|
@@ -1552,14 +1611,19 @@ export type PersistentCacheOptions = {
|
|
|
1552
1611
|
* @default 7 * 24 * 60 * 60
|
|
1553
1612
|
*/
|
|
1554
1613
|
maxAge?: number;
|
|
1614
|
+
/**
|
|
1615
|
+
* Number of generations that unused cache entries stay in the additional
|
|
1616
|
+
* memory cache. Set to 0 to disable the memory cache, or Infinity to keep
|
|
1617
|
+
* entries forever.
|
|
1618
|
+
* @default 5 in development mode, Infinity otherwise
|
|
1619
|
+
*/
|
|
1620
|
+
maxMemoryGenerations?: number;
|
|
1555
1621
|
/**
|
|
1556
1622
|
* @deprecated This option has no effect. Rspack keeps only one persistent
|
|
1557
1623
|
* cache per compiler path.
|
|
1558
1624
|
*/
|
|
1559
1625
|
maxVersions?: number;
|
|
1560
|
-
/**
|
|
1561
|
-
* Snapshot options for determining which files have been modified.
|
|
1562
|
-
*/
|
|
1626
|
+
/** @deprecated Use the top-level `snapshot` option instead. */
|
|
1563
1627
|
snapshot?: CacheSnapshotOptions;
|
|
1564
1628
|
/**
|
|
1565
1629
|
* Storage options for cache.
|
|
@@ -1586,10 +1650,6 @@ export type MemoryCacheOptions = {
|
|
|
1586
1650
|
* Cache type.
|
|
1587
1651
|
*/
|
|
1588
1652
|
type: 'memory';
|
|
1589
|
-
/**
|
|
1590
|
-
* Snapshot options for determining which files have been modified.
|
|
1591
|
-
*/
|
|
1592
|
-
snapshot?: CacheSnapshotOptions;
|
|
1593
1653
|
};
|
|
1594
1654
|
/**
|
|
1595
1655
|
* Options for caching snapshots and intermediate products during the build process.
|
|
@@ -1649,6 +1709,10 @@ export type StatsOptions = {
|
|
|
1649
1709
|
* @default true
|
|
1650
1710
|
*/
|
|
1651
1711
|
assets?: boolean;
|
|
1712
|
+
/**
|
|
1713
|
+
* Includes cache hit, miss, reuse, and store counts by cache name.
|
|
1714
|
+
*/
|
|
1715
|
+
cacheInfo?: boolean;
|
|
1652
1716
|
/**
|
|
1653
1717
|
* Enables or disables the display of chunk stats.
|
|
1654
1718
|
* @default true
|
|
@@ -2070,6 +2134,11 @@ type SharedOptimizationSplitChunksCacheGroup = {
|
|
|
2070
2134
|
*/
|
|
2071
2135
|
minSize?: OptimizationSplitChunksSizes;
|
|
2072
2136
|
minSizeReduction?: OptimizationSplitChunksSizes;
|
|
2137
|
+
/**
|
|
2138
|
+
* Minimum size of the chunk remaining after splitting from a single chunk.
|
|
2139
|
+
* Defaults to 0 in development mode and minSize otherwise.
|
|
2140
|
+
*/
|
|
2141
|
+
minRemainingSize?: OptimizationSplitChunksSizes;
|
|
2073
2142
|
/**
|
|
2074
2143
|
* Size threshold at which splitting is enforced and other restrictions
|
|
2075
2144
|
* (minRemainingSize, maxAsyncRequests, maxInitialRequests) are ignored.
|
|
@@ -2133,6 +2202,13 @@ export type OptimizationSplitChunksCacheGroup = {
|
|
|
2133
2202
|
} & SharedOptimizationSplitChunksCacheGroup;
|
|
2134
2203
|
/** Tell Rspack how to splitting chunks. */
|
|
2135
2204
|
export type OptimizationSplitChunksOptions = {
|
|
2205
|
+
/**
|
|
2206
|
+
* Maximum rounds of intersection discovery for additional shared-module groups.
|
|
2207
|
+
* Defaults to `1` (pairwise intersections) in production and `0` otherwise.
|
|
2208
|
+
* Set `0` to disable discovery.
|
|
2209
|
+
* Higher depths allow newly discovered intersections to participate in the next round.
|
|
2210
|
+
*/
|
|
2211
|
+
dedupDepth?: number;
|
|
2136
2212
|
/**
|
|
2137
2213
|
* Options for module cache group
|
|
2138
2214
|
* */
|
|
@@ -2167,8 +2243,9 @@ export type Optimization = {
|
|
|
2167
2243
|
moduleIds?: false | 'named' | 'natural' | 'deterministic' | 'compact-hashed' | CompatHashedIds | 'hashed';
|
|
2168
2244
|
/**
|
|
2169
2245
|
* Which algorithm to use when choosing chunk ids.
|
|
2170
|
-
* Setting to `false` disables
|
|
2171
|
-
*
|
|
2246
|
+
* Setting this to `false` disables automatic chunk ID assignment. Add a chunk ID
|
|
2247
|
+
* plugin from `rspack.ids`, such as `new rspack.ids.CompactHashedChunkIdsPlugin()`,
|
|
2248
|
+
* to `plugins`. Custom JavaScript plugins cannot currently assign chunk IDs.
|
|
2172
2249
|
*/
|
|
2173
2250
|
chunkIds?: false | 'natural' | 'named' | 'deterministic' | 'compact-hashed' | CompatHashedIds | 'size' | 'total-size';
|
|
2174
2251
|
/**
|
|
@@ -2412,12 +2489,16 @@ export type UseInputFileSystem = false | RegExp[];
|
|
|
2412
2489
|
export type NewCache = {
|
|
2413
2490
|
/** Enable the module code generation cache. @default true */
|
|
2414
2491
|
codeGeneration?: boolean;
|
|
2492
|
+
/** Enable the module build cache. @default true */
|
|
2493
|
+
module?: boolean;
|
|
2415
2494
|
/** Enable the devtool asset cache. @default true */
|
|
2416
2495
|
devtool?: boolean;
|
|
2417
2496
|
/** Enable the per-loader cache. @default true */
|
|
2418
2497
|
loader?: boolean;
|
|
2419
2498
|
/** Enable the asset minimization cache. @default true */
|
|
2420
2499
|
minimize?: boolean;
|
|
2500
|
+
/** Enable the module and loader resolution cache. @default false */
|
|
2501
|
+
resolver?: boolean;
|
|
2421
2502
|
};
|
|
2422
2503
|
export type NewCachePresets = boolean;
|
|
2423
2504
|
/**
|
|
@@ -2514,8 +2595,10 @@ export type WatchOptions = {
|
|
|
2514
2595
|
followSymlinks?: boolean;
|
|
2515
2596
|
/**
|
|
2516
2597
|
* Ignore some files from being watched.
|
|
2598
|
+
* A function receives each entry and must return `true` to ignore it; unlike
|
|
2599
|
+
* the other forms, its path keeps the platform separators.
|
|
2517
2600
|
*/
|
|
2518
|
-
ignored?: string | RegExp | string[];
|
|
2601
|
+
ignored?: string | RegExp | (string | RegExp)[] | ((entry: string) => boolean);
|
|
2519
2602
|
/**
|
|
2520
2603
|
* Turn on polling by passing true, or specifying a poll interval in milliseconds.
|
|
2521
2604
|
* @default false
|
|
@@ -2632,6 +2715,8 @@ export type RspackOptions = {
|
|
|
2632
2715
|
* Options for caching.
|
|
2633
2716
|
*/
|
|
2634
2717
|
cache?: CacheOptions;
|
|
2718
|
+
/** Options for detecting changes to dependencies. */
|
|
2719
|
+
snapshot?: SnapshotOptions;
|
|
2635
2720
|
/**
|
|
2636
2721
|
* The context in which the compilation should occur.
|
|
2637
2722
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type BuiltinPlugin, BuiltinPluginName } from '@
|
|
1
|
+
import { type BuiltinPlugin, BuiltinPluginName } from '@rspack/binding';
|
|
2
2
|
import { RspackBuiltinPlugin } from '../builtin-plugin/base.js';
|
|
3
3
|
import type { Compiler } from '../Compiler.js';
|
|
4
4
|
import type { EntryRuntime, FilenameTemplate, LibraryOptions } from '../config/index.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type BuiltinPlugin, BuiltinPluginName } from '@
|
|
1
|
+
import { type BuiltinPlugin, BuiltinPluginName } from '@rspack/binding';
|
|
2
2
|
import { RspackBuiltinPlugin } from '../builtin-plugin/base.js';
|
|
3
3
|
import type { Compiler } from '../Compiler.js';
|
|
4
4
|
import type { ExternalsType } from '../config/index.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type BuiltinPlugin, BuiltinPluginName } from '@
|
|
1
|
+
import { type BuiltinPlugin, BuiltinPluginName } from '@rspack/binding';
|
|
2
2
|
import { RspackBuiltinPlugin } from '../builtin-plugin/base.js';
|
|
3
3
|
import type { Compiler } from '../Compiler.js';
|
|
4
4
|
import { type ModuleFederationPluginOptions } from './ModuleFederationPlugin.js';
|
|
@@ -7,7 +7,11 @@ export interface ModuleFederationPluginV1Options {
|
|
|
7
7
|
exposes?: Exposes;
|
|
8
8
|
filename?: string;
|
|
9
9
|
library?: LibraryOptions;
|
|
10
|
-
|
|
10
|
+
/**
|
|
11
|
+
* The container name. A non-empty string is required when exposing modules
|
|
12
|
+
* or enabling shared dependency tree shaking.
|
|
13
|
+
*/
|
|
14
|
+
name?: string;
|
|
11
15
|
remoteType?: ExternalsType;
|
|
12
16
|
remotes?: Remotes;
|
|
13
17
|
runtime?: EntryRuntime;
|
|
@@ -10,7 +10,7 @@ export declare const ModuleFederationRuntimePlugin: {
|
|
|
10
10
|
name: string;
|
|
11
11
|
_args: [options?: ModuleFederationRuntimeOptions | undefined];
|
|
12
12
|
affectedHooks: keyof import("../index.js").CompilerHooks | undefined;
|
|
13
|
-
raw(compiler: import("../index.js").Compiler): import("@
|
|
13
|
+
raw(compiler: import("../index.js").Compiler): import("@rspack/binding").BuiltinPlugin;
|
|
14
14
|
apply(compiler: import("../index.js").Compiler): void;
|
|
15
15
|
};
|
|
16
16
|
};
|
package/dist/cssExtractHmr.js
CHANGED
|
@@ -15,7 +15,7 @@ function normalizeUrl(url) {
|
|
|
15
15
|
return accumulator;
|
|
16
16
|
}, []).join('/');
|
|
17
17
|
}
|
|
18
|
-
let srcByModuleId = Object.create(null), noDocument = "u" < typeof document, { forEach
|
|
18
|
+
let srcByModuleId = Object.create(null), noDocument = "u" < typeof document, { forEach } = Array.prototype;
|
|
19
19
|
function noop() {}
|
|
20
20
|
function updateCss(el, url) {
|
|
21
21
|
let normalizedUrl;
|