ndjjd-vite-plugin-federation 0.0.3 → 0.0.4
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/index.d.ts +31 -0
- package/package.json +3 -3
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Plugin } from 'vite';
|
|
2
|
+
|
|
3
|
+
export interface FederationPluginOptions {
|
|
4
|
+
/**
|
|
5
|
+
* 远程模块导入前缀,默认值:'vr:'
|
|
6
|
+
*/
|
|
7
|
+
prefix?: string;
|
|
8
|
+
/**
|
|
9
|
+
* 自定义搜索函数,用于根据组件名称获取远程ZIP包地址
|
|
10
|
+
* @param name 组件名称
|
|
11
|
+
* @returns 远程ZIP包地址Promise
|
|
12
|
+
*/
|
|
13
|
+
search?: (name: string) => Promise<string>;
|
|
14
|
+
/**
|
|
15
|
+
* 组件缓存目录,默认值:'./node_modules/.vr-cache'
|
|
16
|
+
*/
|
|
17
|
+
cacheDir?: string;
|
|
18
|
+
/**
|
|
19
|
+
* 是否启用缓存,默认值:true
|
|
20
|
+
*/
|
|
21
|
+
enableCache?: boolean;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Vite 远程组件联邦插件
|
|
26
|
+
* @param options 插件配置项
|
|
27
|
+
* @returns Vite Plugin 实例
|
|
28
|
+
*/
|
|
29
|
+
export function FederationPlugin(options?: FederationPluginOptions): Plugin;
|
|
30
|
+
|
|
31
|
+
export default FederationPlugin;
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ndjjd-vite-plugin-federation",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
7
|
-
"types": "dist/types/
|
|
8
|
-
"typings": "dist/types/
|
|
7
|
+
"types": "dist/types/vite.d.ts",
|
|
8
|
+
"typings": "dist/types/vite.d.ts",
|
|
9
9
|
"keywords": [
|
|
10
10
|
"vite",
|
|
11
11
|
"vite-plugin",
|