@module-federation/vite 1.0.0-alpha-54ad191 → 1.0.0-alpha-4a73cd4
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/lib/index.cjs +412 -352
- package/lib/index.esm.js +413 -351
- package/lib/index.modern.js +460 -333
- package/lib/index.umd.js +414 -354
- package/lib/plugins/pluginProxyRemoteEntry.d.ts +2 -0
- package/lib/plugins/pluginProxyRemotes.d.ts +3 -0
- package/lib/plugins/pluginProxySharedModule_preBuild.d.ts +7 -0
- package/lib/utils/normalizeModuleFederationOptions.d.ts +2 -1
- package/lib/virtualModules/virtualRemoteEntry.d.ts +11 -0
- package/lib/virtualModules/virtualRemotes.d.ts +5 -0
- package/lib/virtualModules/virtualShared_preBuild.d.ts +12 -0
- package/package.json +4 -2
- package/lib/utils/vitePluginOverrideModule.d.ts +0 -6
- /package/lib/{utils/vitePluginAddEntry.d.ts → plugins/pluginAddEntry.d.ts} +0 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Plugin } from 'vite';
|
|
2
|
+
import { NormalizedShared } from '../utils/normalizeModuleFederationOptions';
|
|
3
|
+
export declare function proxySharedModule(options: {
|
|
4
|
+
shared?: NormalizedShared;
|
|
5
|
+
include?: string | string[];
|
|
6
|
+
exclude?: string | string[];
|
|
7
|
+
}): Plugin[];
|
|
@@ -19,7 +19,7 @@ export declare function normalizeRemotes(remotes: Record<string, string | {
|
|
|
19
19
|
entryGlobalName: string;
|
|
20
20
|
shareScope: string;
|
|
21
21
|
}>;
|
|
22
|
-
interface ShareItem {
|
|
22
|
+
export interface ShareItem {
|
|
23
23
|
name: string;
|
|
24
24
|
version: string | undefined;
|
|
25
25
|
scope: string;
|
|
@@ -79,5 +79,6 @@ export interface NormalizedModuleFederationOptions {
|
|
|
79
79
|
dev: any;
|
|
80
80
|
dts: any;
|
|
81
81
|
}
|
|
82
|
+
export declare function getNormalizeModuleFederationOptions(): NormalizedModuleFederationOptions;
|
|
82
83
|
export declare function normalizeModuleFederationOptions(options: ModuleFederationOptions): NormalizedModuleFederationOptions;
|
|
83
84
|
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { NormalizedModuleFederationOptions } from "../utils/normalizeModuleFederationOptions";
|
|
2
|
+
export declare const REMOTE_ENTRY_ID = "REMOTE_ENTRY_ID";
|
|
3
|
+
export declare function generateRemoteEntry(options: NormalizedModuleFederationOptions): string;
|
|
4
|
+
export declare const WRAP_REMOTE_ENTRY_PATH: string;
|
|
5
|
+
export declare function generateWrapRemoteEntry(): string;
|
|
6
|
+
/**
|
|
7
|
+
* Inject entry file, automatically init when used as host,
|
|
8
|
+
* and will not inject remoteEntry
|
|
9
|
+
*/
|
|
10
|
+
export declare const HOST_AUTO_INIT: string;
|
|
11
|
+
export declare function generateWrapHostInit(): string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Even the resolveId hook cannot interfere with vite pre-build,
|
|
3
|
+
* and adding query parameter virtual modules will also fail.
|
|
4
|
+
* You can only proxy to the real file through alias
|
|
5
|
+
*/
|
|
6
|
+
import { ShareItem } from "../utils/normalizeModuleFederationOptions";
|
|
7
|
+
export declare function getPreBuildLibPath(pkg: string): string;
|
|
8
|
+
export declare function getLocalSharedImportMapId(): string;
|
|
9
|
+
export declare function getLocalSharedImportMapPath(): string;
|
|
10
|
+
export declare function writeLocalSharedImportMap(pkgList: string[]): void;
|
|
11
|
+
export declare function getLoadShareModulePath(pkg: string): string;
|
|
12
|
+
export declare function writeLoadShareModule(pkg: string, shareItem: ShareItem, command: string): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@module-federation/vite",
|
|
3
|
-
"version": "1.0.0-alpha-
|
|
3
|
+
"version": "1.0.0-alpha-4a73cd4",
|
|
4
4
|
"description": "Vite plugin for Module Federation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"source": "src/index.ts",
|
|
@@ -13,7 +13,9 @@
|
|
|
13
13
|
"prepare": "husky install",
|
|
14
14
|
"format": "pretty-quick",
|
|
15
15
|
"dev": "microbundle watch",
|
|
16
|
-
"build": "rimraf lib && microbundle --no-sourcemap --compress=false"
|
|
16
|
+
"build": "rimraf lib && microbundle --no-sourcemap --compress=false",
|
|
17
|
+
"dev-rust-vite": "pnpm -filter 'examples-rust-vite*' run dev",
|
|
18
|
+
"dev-vite-vite": "pnpm -filter 'examples-vite-vite*' run dev"
|
|
17
19
|
},
|
|
18
20
|
"repository": {
|
|
19
21
|
"type": "git",
|
|
File without changes
|