@rspack-canary/core 1.6.7-canary-5041023c-20251208041143 → 1.6.7-canary-e27a87e9-20251209100543
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/builtin-plugin/css-extract/loader.d.ts +4 -4
- package/dist/container/ModuleFederationManifestPlugin.d.ts +9 -2
- package/dist/container/ModuleFederationPlugin.d.ts +15 -1
- package/dist/cssExtractLoader.js +2 -2
- package/dist/exports.d.ts +3 -0
- package/dist/index.js +620 -245
- package/dist/moduleFederationDefaultRuntime.js +1 -1
- package/dist/sharing/CollectSharedEntryPlugin.d.ts +22 -0
- package/dist/sharing/ConsumeSharedPlugin.d.ts +16 -0
- package/dist/sharing/IndependentSharedPlugin.d.ts +33 -0
- package/dist/sharing/ProvideSharedPlugin.d.ts +19 -0
- package/dist/sharing/SharePlugin.d.ts +36 -0
- package/dist/sharing/SharedContainerPlugin.d.ts +23 -0
- package/dist/sharing/SharedUsedExportsOptimizerPlugin.d.ts +14 -0
- package/dist/sharing/TreeShakeSharedPlugin.d.ts +19 -0
- package/dist/sharing/utils.d.ts +1 -0
- package/package.json +3 -3
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { LoaderContext, LoaderDefinition } from "../..";
|
|
2
|
-
export declare const BASE_URI = "
|
|
2
|
+
export declare const BASE_URI = "rspack-css-extract://";
|
|
3
3
|
export declare const MODULE_TYPE = "css/mini-extract";
|
|
4
|
-
export declare const AUTO_PUBLIC_PATH = "
|
|
5
|
-
export declare const ABSOLUTE_PUBLIC_PATH = "
|
|
6
|
-
export declare const SINGLE_DOT_PATH_SEGMENT = "
|
|
4
|
+
export declare const AUTO_PUBLIC_PATH = "__css_extract_public_path_auto__";
|
|
5
|
+
export declare const ABSOLUTE_PUBLIC_PATH = "rspack-css-extract:///css-extract-plugin/";
|
|
6
|
+
export declare const SINGLE_DOT_PATH_SEGMENT = "__css_extract_single_dot_path_segment__";
|
|
7
7
|
export interface CssExtractRspackLoaderOptions {
|
|
8
8
|
publicPath?: string | ((resourcePath: string, context: string) => string);
|
|
9
9
|
emit?: boolean;
|
|
@@ -1,6 +1,7 @@
|
|
|
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";
|
|
4
5
|
export type RemoteAliasMap = Record<string, {
|
|
5
6
|
name: string;
|
|
6
7
|
entry?: string;
|
|
@@ -15,7 +16,7 @@ export type ManifestSharedOption = {
|
|
|
15
16
|
requiredVersion?: string;
|
|
16
17
|
singleton?: boolean;
|
|
17
18
|
};
|
|
18
|
-
|
|
19
|
+
type InternalManifestPluginOptions = {
|
|
19
20
|
name?: string;
|
|
20
21
|
globalName?: string;
|
|
21
22
|
filePath?: string;
|
|
@@ -25,6 +26,11 @@ export type ModuleFederationManifestPluginOptions = {
|
|
|
25
26
|
exposes?: ManifestExposeOption[];
|
|
26
27
|
shared?: ManifestSharedOption[];
|
|
27
28
|
};
|
|
29
|
+
export type ModuleFederationManifestPluginOptions = boolean | Pick<InternalManifestPluginOptions, "disableAssetsAnalyze" | "filePath" | "fileName">;
|
|
30
|
+
export declare function getFileName(manifestOptions: ModuleFederationManifestPluginOptions): {
|
|
31
|
+
statsFileName: string;
|
|
32
|
+
manifestFileName: string;
|
|
33
|
+
};
|
|
28
34
|
/**
|
|
29
35
|
* JS-side post-processing plugin: reads mf-manifest.json and mf-stats.json, executes additionalData callback and merges/overwrites manifest.
|
|
30
36
|
* To avoid cross-NAPI callback complexity, this plugin runs at the afterProcessAssets stage to ensure Rust-side MfManifestPlugin has already output its artifacts.
|
|
@@ -32,6 +38,7 @@ export type ModuleFederationManifestPluginOptions = {
|
|
|
32
38
|
export declare class ModuleFederationManifestPlugin extends RspackBuiltinPlugin {
|
|
33
39
|
name: BuiltinPluginName;
|
|
34
40
|
private opts;
|
|
35
|
-
constructor(opts:
|
|
41
|
+
constructor(opts: ModuleFederationPluginOptions);
|
|
36
42
|
raw(compiler: Compiler): BuiltinPlugin;
|
|
37
43
|
}
|
|
44
|
+
export {};
|
|
@@ -1,15 +1,29 @@
|
|
|
1
1
|
import type { Compiler } from "../Compiler";
|
|
2
|
+
import type { ExternalsType } from "../config";
|
|
2
3
|
import { type ModuleFederationManifestPluginOptions } from "./ModuleFederationManifestPlugin";
|
|
3
4
|
import type { ModuleFederationPluginV1Options } from "./ModuleFederationPluginV1";
|
|
4
5
|
export interface ModuleFederationPluginOptions extends Omit<ModuleFederationPluginV1Options, "enhanced"> {
|
|
5
6
|
runtimePlugins?: RuntimePlugins;
|
|
6
7
|
implementation?: string;
|
|
7
8
|
shareStrategy?: "version-first" | "loaded-first";
|
|
8
|
-
|
|
9
|
+
injectUsedExports?: boolean;
|
|
10
|
+
independentShareDir?: string;
|
|
11
|
+
manifest?: ModuleFederationManifestPluginOptions;
|
|
9
12
|
}
|
|
10
13
|
export type RuntimePlugins = string[] | [string, Record<string, unknown>][];
|
|
11
14
|
export declare class ModuleFederationPlugin {
|
|
12
15
|
private _options;
|
|
16
|
+
private _treeShakeSharedPlugin?;
|
|
13
17
|
constructor(_options: ModuleFederationPluginOptions);
|
|
14
18
|
apply(compiler: Compiler): void;
|
|
15
19
|
}
|
|
20
|
+
interface RemoteInfo {
|
|
21
|
+
alias: string;
|
|
22
|
+
name?: string;
|
|
23
|
+
entry?: string;
|
|
24
|
+
externalType: ExternalsType;
|
|
25
|
+
shareScope: string;
|
|
26
|
+
}
|
|
27
|
+
type RemoteInfos = Record<string, RemoteInfo[]>;
|
|
28
|
+
export declare function getRemoteInfos(options: ModuleFederationPluginOptions): RemoteInfos;
|
|
29
|
+
export {};
|
package/dist/cssExtractLoader.js
CHANGED
|
@@ -33,7 +33,7 @@ var external_node_path_default = __webpack_require__.n(external_node_path_namesp
|
|
|
33
33
|
function isAbsolutePath(str) {
|
|
34
34
|
return external_node_path_default().posix.isAbsolute(str) || external_node_path_default().win32.isAbsolute(str);
|
|
35
35
|
}
|
|
36
|
-
const PLUGIN_NAME = "css-extract-rspack-plugin", RELATIVE_PATH_REGEXP = /^\.\.?[/\\]/, BASE_URI = "
|
|
36
|
+
const PLUGIN_NAME = "css-extract-rspack-plugin", RELATIVE_PATH_REGEXP = /^\.\.?[/\\]/, BASE_URI = "rspack-css-extract://", MODULE_TYPE = "css/mini-extract", AUTO_PUBLIC_PATH = "__css_extract_public_path_auto__", ABSOLUTE_PUBLIC_PATH = `${BASE_URI}/css-extract-plugin/`, SINGLE_DOT_PATH_SEGMENT = "__css_extract_single_dot_path_segment__";
|
|
37
37
|
function hotLoader(content, context) {
|
|
38
38
|
let localsJsonString = JSON.stringify(JSON.stringify(context.locals));
|
|
39
39
|
return `${content}
|
|
@@ -135,7 +135,7 @@ const pitch = function(request, _, data) {
|
|
|
135
135
|
locals: locals
|
|
136
136
|
}) : result, dependencies.length > 0 && this.__internal__setParseMeta(PLUGIN_NAME, JSON.stringify(dependencies)), callback(null, resultSource, void 0, data);
|
|
137
137
|
};
|
|
138
|
-
this.importModule(`${this.resourcePath}.
|
|
138
|
+
this.importModule(`${this.resourcePath}.rspack[javascript/auto]!=!!!${request}`, {
|
|
139
139
|
layer: options.layer,
|
|
140
140
|
publicPath: publicPathForExtract,
|
|
141
141
|
baseUri: `${BASE_URI}/`
|
package/dist/exports.d.ts
CHANGED
|
@@ -119,11 +119,14 @@ export declare const container: {
|
|
|
119
119
|
import { ConsumeSharedPlugin } from "./sharing/ConsumeSharedPlugin";
|
|
120
120
|
import { ProvideSharedPlugin } from "./sharing/ProvideSharedPlugin";
|
|
121
121
|
import { SharePlugin } from "./sharing/SharePlugin";
|
|
122
|
+
import { TreeShakeSharedPlugin } from "./sharing/TreeShakeSharedPlugin";
|
|
122
123
|
export type { ConsumeSharedPluginOptions, Consumes, ConsumesConfig, ConsumesItem, ConsumesObject } from "./sharing/ConsumeSharedPlugin";
|
|
123
124
|
export type { ProvideSharedPluginOptions, Provides, ProvidesConfig, ProvidesItem, ProvidesObject } from "./sharing/ProvideSharedPlugin";
|
|
124
125
|
export type { Shared, SharedConfig, SharedItem, SharedObject, SharePluginOptions } from "./sharing/SharePlugin";
|
|
126
|
+
export type { TreeshakeSharedPluginOptions } from "./sharing/TreeShakeSharedPlugin";
|
|
125
127
|
export declare const sharing: {
|
|
126
128
|
ProvideSharedPlugin: typeof ProvideSharedPlugin;
|
|
129
|
+
TreeShakeSharedPlugin: typeof TreeShakeSharedPlugin;
|
|
127
130
|
ConsumeSharedPlugin: typeof ConsumeSharedPlugin;
|
|
128
131
|
SharePlugin: typeof SharePlugin;
|
|
129
132
|
};
|