@rspack-canary/core 1.7.0-canary-c8f933e3-20251224124051 → 1.7.0-canary-08772c3f-20251224173339
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Compiler.d.ts +3 -0
- package/dist/builtin-loader/swc/types.d.ts +6 -0
- package/dist/builtin-plugin/{WarnCaseSensitiveModulesPlugin.d.ts → CaseSensitivePlugin.d.ts} +1 -1
- package/dist/builtin-plugin/index.d.ts +1 -1
- package/dist/config/defaults.d.ts +10 -1
- package/dist/config/normalization.d.ts +0 -4
- package/dist/config/target.d.ts +6 -6
- package/dist/config/types.d.ts +1 -5
- package/dist/container/ModuleFederationManifestPlugin.d.ts +3 -10
- package/dist/container/ModuleFederationPlugin.d.ts +1 -16
- package/dist/exports.d.ts +5 -4
- package/dist/index.js +359 -730
- package/dist/moduleFederationDefaultRuntime.js +1 -1
- package/dist/rspack.d.ts +9 -0
- package/dist/sharing/ConsumeSharedPlugin.d.ts +0 -16
- package/dist/sharing/ProvideSharedPlugin.d.ts +0 -19
- package/dist/sharing/SharePlugin.d.ts +0 -36
- package/dist/sharing/utils.d.ts +0 -1
- package/dist/util/index.d.ts +1 -0
- package/package.json +3 -3
- package/dist/sharing/CollectSharedEntryPlugin.d.ts +0 -22
- package/dist/sharing/IndependentSharedPlugin.d.ts +0 -35
- package/dist/sharing/SharedContainerPlugin.d.ts +0 -23
- package/dist/sharing/SharedUsedExportsOptimizerPlugin.d.ts +0 -14
- package/dist/sharing/TreeShakeSharedPlugin.d.ts +0 -19
package/dist/Compiler.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ import type { CompilationParams } from "./Compilation";
|
|
|
16
16
|
import { Compilation } from "./Compilation";
|
|
17
17
|
import { ContextModuleFactory } from "./ContextModuleFactory";
|
|
18
18
|
import type { EntryNormalized, OutputNormalized, RspackOptionsNormalized, RspackPluginInstance } from "./config";
|
|
19
|
+
import type { PlatformTargetProperties } from "./config/target";
|
|
19
20
|
import type { FileSystemInfoEntry } from "./FileSystemInfo";
|
|
20
21
|
import { rspack } from "./index";
|
|
21
22
|
import Cache from "./lib/Cache";
|
|
@@ -126,6 +127,8 @@ declare class Compiler {
|
|
|
126
127
|
get managedPaths(): never;
|
|
127
128
|
get immutablePaths(): never;
|
|
128
129
|
get _lastCompilation(): Compilation | undefined;
|
|
130
|
+
get platform(): PlatformTargetProperties;
|
|
131
|
+
set platform(platform: PlatformTargetProperties);
|
|
129
132
|
/**
|
|
130
133
|
* Note: This is not a webpack public API, maybe removed in future.
|
|
131
134
|
* @internal
|
|
@@ -10,6 +10,11 @@ export type SwcLoaderTsParserConfig = TsParserConfig;
|
|
|
10
10
|
export type SwcLoaderTransformConfig = TransformConfig;
|
|
11
11
|
export type SwcLoaderOptions = Config & {
|
|
12
12
|
isModule?: boolean | "unknown";
|
|
13
|
+
/**
|
|
14
|
+
* Collects information from TypeScript's AST for consumption by subsequent Rspack processes,
|
|
15
|
+
* providing better TypeScript development experience and smaller output bundle size.
|
|
16
|
+
*/
|
|
17
|
+
collectTypeScriptInfo?: CollectTypeScriptInfoOptions;
|
|
13
18
|
/**
|
|
14
19
|
* Experimental features provided by Rspack.
|
|
15
20
|
* @experimental
|
|
@@ -17,6 +22,7 @@ export type SwcLoaderOptions = Config & {
|
|
|
17
22
|
rspackExperiments?: {
|
|
18
23
|
import?: PluginImportOptions;
|
|
19
24
|
/**
|
|
25
|
+
* @deprecated Use top-level `collectTypeScriptInfo` instead.
|
|
20
26
|
* Collects information from TypeScript's AST for consumption by subsequent Rspack processes,
|
|
21
27
|
* providing better TypeScript development experience and smaller output bundle size.
|
|
22
28
|
*/
|
|
@@ -5,6 +5,7 @@ export * from "./AsyncWebAssemblyModulesPlugin";
|
|
|
5
5
|
export * from "./BannerPlugin";
|
|
6
6
|
export * from "./BundlerInfoRspackPlugin";
|
|
7
7
|
export { createNativePlugin, RspackBuiltinPlugin } from "./base";
|
|
8
|
+
export * from "./CaseSensitivePlugin";
|
|
8
9
|
export * from "./ChunkPrefetchPreloadPlugin";
|
|
9
10
|
export * from "./CircularDependencyRspackPlugin";
|
|
10
11
|
export * from "./CommonJsChunkFormatPlugin";
|
|
@@ -79,6 +80,5 @@ export * from "./SplitChunksPlugin";
|
|
|
79
80
|
export * from "./SubresourceIntegrityPlugin";
|
|
80
81
|
export * from "./SwcJsMinimizerPlugin";
|
|
81
82
|
export * from "./URLPlugin";
|
|
82
|
-
export * from "./WarnCaseSensitiveModulesPlugin";
|
|
83
83
|
export * from "./WebWorkerTemplatePlugin";
|
|
84
84
|
export * from "./WorkerPlugin";
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
import type { RspackOptionsNormalized } from "./normalization";
|
|
2
|
-
export declare const applyRspackOptionsDefaults: (options: RspackOptionsNormalized) =>
|
|
2
|
+
export declare const applyRspackOptionsDefaults: (options: RspackOptionsNormalized) => {
|
|
3
|
+
platform: false | {
|
|
4
|
+
web: boolean | null | undefined;
|
|
5
|
+
browser: boolean | null | undefined;
|
|
6
|
+
webworker: boolean | null | undefined;
|
|
7
|
+
node: boolean | null | undefined;
|
|
8
|
+
nwjs: boolean | null | undefined;
|
|
9
|
+
electron: boolean | null | undefined;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
3
12
|
export declare const applyRspackOptionsBaseDefaults: (options: RspackOptionsNormalized) => void;
|
|
4
13
|
export declare const getPnpDefault: () => boolean;
|
|
@@ -111,10 +111,6 @@ export interface ExperimentsNormalized {
|
|
|
111
111
|
*/
|
|
112
112
|
layers?: boolean;
|
|
113
113
|
incremental?: false | Incremental;
|
|
114
|
-
/**
|
|
115
|
-
* @deprecated This option is deprecated, as it has a huge regression in some edge cases where the chunk graph has lots of cycles. We will improve performance of build_chunk_graph.
|
|
116
|
-
*/
|
|
117
|
-
parallelCodeSplitting?: boolean;
|
|
118
114
|
futureDefaults?: boolean;
|
|
119
115
|
rspackFuture?: RspackFutureOptions;
|
|
120
116
|
buildHttp?: HttpUriPluginOptions;
|
package/dist/config/target.d.ts
CHANGED
|
@@ -5,17 +5,17 @@
|
|
|
5
5
|
export declare const getDefaultTarget: (context: string) => "browserslist" | "web";
|
|
6
6
|
export type PlatformTargetProperties = {
|
|
7
7
|
/** web platform, importing of http(s) and std: is available */
|
|
8
|
-
web
|
|
8
|
+
web?: boolean | null;
|
|
9
9
|
/** browser platform, running in a normal web browser */
|
|
10
|
-
browser
|
|
10
|
+
browser?: boolean | null;
|
|
11
11
|
/** (Web)Worker platform, running in a web/shared/service worker */
|
|
12
|
-
webworker
|
|
12
|
+
webworker?: boolean | null;
|
|
13
13
|
/** node platform, require of node built-in modules is available */
|
|
14
|
-
node
|
|
14
|
+
node?: boolean | null;
|
|
15
15
|
/** nwjs platform, require of legacy nw.gui is available */
|
|
16
|
-
nwjs
|
|
16
|
+
nwjs?: boolean | null;
|
|
17
17
|
/** electron platform, require of some electron built-in modules is available */
|
|
18
|
-
electron
|
|
18
|
+
electron?: boolean | null;
|
|
19
19
|
};
|
|
20
20
|
export type ElectronContextTargetProperties = {
|
|
21
21
|
/** in main context */
|
package/dist/config/types.d.ts
CHANGED
|
@@ -2103,6 +2103,7 @@ export type Experiments = {
|
|
|
2103
2103
|
outputModule?: boolean;
|
|
2104
2104
|
/**
|
|
2105
2105
|
* Enable top-level await.
|
|
2106
|
+
* @deprecated This option is deprecated, top-level await is enabled by default.
|
|
2106
2107
|
* @default true
|
|
2107
2108
|
*/
|
|
2108
2109
|
topLevelAwait?: boolean;
|
|
@@ -2129,11 +2130,6 @@ export type Experiments = {
|
|
|
2129
2130
|
* Enable incremental builds.
|
|
2130
2131
|
*/
|
|
2131
2132
|
incremental?: IncrementalPresets | Incremental;
|
|
2132
|
-
/**
|
|
2133
|
-
* Enable multi-threaded code splitting algorithm.
|
|
2134
|
-
* @deprecated This option is deprecated, it has a huge regression in some edge cases where the chunk graph has lots of cycles. We'll improve the performance of build_chunk_graph in the future instead
|
|
2135
|
-
*/
|
|
2136
|
-
parallelCodeSplitting?: boolean;
|
|
2137
2133
|
/**
|
|
2138
2134
|
* Enable future default options.
|
|
2139
2135
|
* @default false
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { type BuiltinPlugin, BuiltinPluginName } from "@rspack/binding";
|
|
2
2
|
import { RspackBuiltinPlugin } from "../builtin-plugin/base";
|
|
3
3
|
import type { Compiler } from "../Compiler";
|
|
4
|
-
import { type ModuleFederationPluginOptions } from "./ModuleFederationPlugin";
|
|
5
4
|
export type RemoteAliasMap = Record<string, {
|
|
6
5
|
name: string;
|
|
7
6
|
entry?: string;
|
|
@@ -16,7 +15,7 @@ export type ManifestSharedOption = {
|
|
|
16
15
|
requiredVersion?: string;
|
|
17
16
|
singleton?: boolean;
|
|
18
17
|
};
|
|
19
|
-
type
|
|
18
|
+
export type ModuleFederationManifestPluginOptions = {
|
|
20
19
|
name?: string;
|
|
21
20
|
globalName?: string;
|
|
22
21
|
filePath?: string;
|
|
@@ -26,19 +25,13 @@ type InternalManifestPluginOptions = {
|
|
|
26
25
|
exposes?: ManifestExposeOption[];
|
|
27
26
|
shared?: ManifestSharedOption[];
|
|
28
27
|
};
|
|
29
|
-
export type ModuleFederationManifestPluginOptions = boolean | Pick<InternalManifestPluginOptions, "disableAssetsAnalyze" | "filePath" | "fileName">;
|
|
30
|
-
export declare function getFileName(manifestOptions: ModuleFederationManifestPluginOptions): {
|
|
31
|
-
statsFileName: string;
|
|
32
|
-
manifestFileName: string;
|
|
33
|
-
};
|
|
34
28
|
/**
|
|
35
29
|
* JS-side post-processing plugin: reads mf-manifest.json and mf-stats.json, executes additionalData callback and merges/overwrites manifest.
|
|
36
30
|
* To avoid cross-NAPI callback complexity, this plugin runs at the afterProcessAssets stage to ensure Rust-side MfManifestPlugin has already output its artifacts.
|
|
37
31
|
*/
|
|
38
32
|
export declare class ModuleFederationManifestPlugin extends RspackBuiltinPlugin {
|
|
39
33
|
name: BuiltinPluginName;
|
|
40
|
-
private
|
|
41
|
-
constructor(opts:
|
|
34
|
+
private opts;
|
|
35
|
+
constructor(opts: ModuleFederationManifestPluginOptions);
|
|
42
36
|
raw(compiler: Compiler): BuiltinPlugin;
|
|
43
37
|
}
|
|
44
|
-
export {};
|
|
@@ -1,30 +1,15 @@
|
|
|
1
1
|
import type { Compiler } from "../Compiler";
|
|
2
|
-
import type { ExternalsType } from "../config";
|
|
3
2
|
import { type ModuleFederationManifestPluginOptions } from "./ModuleFederationManifestPlugin";
|
|
4
3
|
import type { ModuleFederationPluginV1Options } from "./ModuleFederationPluginV1";
|
|
5
4
|
export interface ModuleFederationPluginOptions extends Omit<ModuleFederationPluginV1Options, "enhanced"> {
|
|
6
5
|
runtimePlugins?: RuntimePlugins;
|
|
7
6
|
implementation?: string;
|
|
8
7
|
shareStrategy?: "version-first" | "loaded-first";
|
|
9
|
-
manifest?: ModuleFederationManifestPluginOptions
|
|
10
|
-
injectUsedExports?: boolean;
|
|
11
|
-
independentShareDir?: string;
|
|
12
|
-
treeshakeSharedExcludedPlugins?: string[];
|
|
8
|
+
manifest?: boolean | Omit<ModuleFederationManifestPluginOptions, "remoteAliasMap" | "globalName" | "name" | "exposes" | "shared">;
|
|
13
9
|
}
|
|
14
10
|
export type RuntimePlugins = string[] | [string, Record<string, unknown>][];
|
|
15
11
|
export declare class ModuleFederationPlugin {
|
|
16
12
|
private _options;
|
|
17
|
-
private _treeShakeSharedPlugin?;
|
|
18
13
|
constructor(_options: ModuleFederationPluginOptions);
|
|
19
14
|
apply(compiler: Compiler): void;
|
|
20
15
|
}
|
|
21
|
-
interface RemoteInfo {
|
|
22
|
-
alias: string;
|
|
23
|
-
name?: string;
|
|
24
|
-
entry?: string;
|
|
25
|
-
externalType: ExternalsType;
|
|
26
|
-
shareScope: string;
|
|
27
|
-
}
|
|
28
|
-
type RemoteInfos = Record<string, RemoteInfo[]>;
|
|
29
|
-
export declare function getRemoteInfos(options: ModuleFederationPluginOptions): RemoteInfos;
|
|
30
|
-
export {};
|
package/dist/exports.d.ts
CHANGED
|
@@ -47,7 +47,11 @@ export declare const util: {
|
|
|
47
47
|
cleverMerge: <First, Second>(first: First, second: Second) => First | Second | (First & Second);
|
|
48
48
|
};
|
|
49
49
|
export type { BannerPluginArgument, DefinePluginOptions, EntryOptions, ProgressPluginArgument, ProvidePluginOptions } from "./builtin-plugin";
|
|
50
|
-
export { BannerPlugin,
|
|
50
|
+
export { BannerPlugin, CaseSensitivePlugin,
|
|
51
|
+
/**
|
|
52
|
+
* @deprecated Use `rspack.CaseSensitivePlugin` instead
|
|
53
|
+
*/
|
|
54
|
+
CaseSensitivePlugin as WarnCaseSensitiveModulesPlugin, DefinePlugin, DynamicEntryPlugin, EntryPlugin, ExternalsPlugin, HotModuleReplacementPlugin, IgnorePlugin, type IgnorePluginOptions, NoEmitOnErrorsPlugin, ProgressPlugin, ProvidePlugin, RuntimePlugin } from "./builtin-plugin";
|
|
51
55
|
export { DllPlugin, type DllPluginOptions } from "./lib/DllPlugin";
|
|
52
56
|
export { DllReferencePlugin, type DllReferencePluginOptions, type DllReferencePluginOptionsContent, type DllReferencePluginOptionsManifest, type DllReferencePluginOptionsSourceType } from "./lib/DllReferencePlugin";
|
|
53
57
|
export { default as EntryOptionPlugin } from "./lib/EntryOptionPlugin";
|
|
@@ -121,14 +125,11 @@ export declare const container: {
|
|
|
121
125
|
import { ConsumeSharedPlugin } from "./sharing/ConsumeSharedPlugin";
|
|
122
126
|
import { ProvideSharedPlugin } from "./sharing/ProvideSharedPlugin";
|
|
123
127
|
import { SharePlugin } from "./sharing/SharePlugin";
|
|
124
|
-
import { TreeShakeSharedPlugin } from "./sharing/TreeShakeSharedPlugin";
|
|
125
128
|
export type { ConsumeSharedPluginOptions, Consumes, ConsumesConfig, ConsumesItem, ConsumesObject } from "./sharing/ConsumeSharedPlugin";
|
|
126
129
|
export type { ProvideSharedPluginOptions, Provides, ProvidesConfig, ProvidesItem, ProvidesObject } from "./sharing/ProvideSharedPlugin";
|
|
127
130
|
export type { Shared, SharedConfig, SharedItem, SharedObject, SharePluginOptions } from "./sharing/SharePlugin";
|
|
128
|
-
export type { TreeshakeSharedPluginOptions } from "./sharing/TreeShakeSharedPlugin";
|
|
129
131
|
export declare const sharing: {
|
|
130
132
|
ProvideSharedPlugin: typeof ProvideSharedPlugin;
|
|
131
|
-
TreeShakeSharedPlugin: typeof TreeShakeSharedPlugin;
|
|
132
133
|
ConsumeSharedPlugin: typeof ConsumeSharedPlugin;
|
|
133
134
|
SharePlugin: typeof SharePlugin;
|
|
134
135
|
};
|