@lemon-fe/vite-plugin-micro-frontend 1.1.0 → 1.1.2
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 +8 -9
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +9 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { Plugin, PluginOption } from 'vite';
|
|
2
|
+
export { default as cssInjectedByJsPlugin } from 'vite-plugin-css-injected-by-js';
|
|
3
|
+
import { VitePluginFederationOptions } from '@originjs/vite-plugin-federation';
|
|
2
4
|
import { ComponentType } from 'react';
|
|
3
5
|
|
|
4
6
|
/**
|
|
@@ -11,20 +13,17 @@ interface RemoteConfig {
|
|
|
11
13
|
remoteName: string;
|
|
12
14
|
/** 入口文件路径 */
|
|
13
15
|
entry: string;
|
|
16
|
+
/** 是否为 ES Module */
|
|
17
|
+
isESModule?: boolean;
|
|
14
18
|
}
|
|
15
19
|
/**
|
|
16
20
|
* 模块联邦配置
|
|
17
21
|
*/
|
|
18
|
-
interface FederationConfig {
|
|
22
|
+
interface FederationConfig extends Omit<VitePluginFederationOptions, "remotes"> {
|
|
19
23
|
/** 应用名称 */
|
|
20
24
|
name: string;
|
|
21
25
|
/** 远程入口文件名 */
|
|
22
26
|
filename?: string;
|
|
23
|
-
/**
|
|
24
|
-
* 暴露的模块(手动配置)
|
|
25
|
-
* 会与自动扫描的 exposes 合并,手动配置优先级更高
|
|
26
|
-
*/
|
|
27
|
-
exposes?: Record<string, string>;
|
|
28
27
|
/**
|
|
29
28
|
* exposes 目录路径,默认为 src/exposes
|
|
30
29
|
* 插件会自动扫描该目录下的子目录作为暴露的模块
|
|
@@ -33,8 +32,6 @@ interface FederationConfig {
|
|
|
33
32
|
exposesDir?: string;
|
|
34
33
|
/** 远程模块配置 */
|
|
35
34
|
remotes?: RemoteConfig[];
|
|
36
|
-
/** 共享依赖 */
|
|
37
|
-
shared?: string[];
|
|
38
35
|
/** 生成的文件路径,默认为 src/utils/mf.tsx */
|
|
39
36
|
outputPath?: string;
|
|
40
37
|
/**
|
|
@@ -152,6 +149,8 @@ declare function mfGeneratorPlugin(options: MfGeneratorOptions): VitePlugin;
|
|
|
152
149
|
*/
|
|
153
150
|
declare function federationPlugin(federationOptions: FederationConfig): PluginOption[];
|
|
154
151
|
|
|
152
|
+
declare function autoExternalAntd(): Plugin;
|
|
153
|
+
|
|
155
154
|
interface DynamicOptions<P = Record<string, unknown>> {
|
|
156
155
|
/** 动态加载函数,返回一个包含 default 导出的 Promise */
|
|
157
156
|
loader: () => Promise<{
|
|
@@ -212,5 +211,5 @@ declare function getRoutes(opts: IOpts): IRoute[];
|
|
|
212
211
|
*/
|
|
213
212
|
declare function microFrontendPlugins(options: MicroFrontendPluginOptions): PluginOption[];
|
|
214
213
|
|
|
215
|
-
export { dynamic, federationPlugin, getRoutes, htmlRemoveFreshPlugin, mfGeneratorPlugin, microFrontendPlugins, pagesRoutesPlugin };
|
|
214
|
+
export { autoExternalAntd, dynamic, federationPlugin, getRoutes, htmlRemoveFreshPlugin, mfGeneratorPlugin, microFrontendPlugins, pagesRoutesPlugin };
|
|
216
215
|
export type { ComponentMetadata, DynamicOptions, FederationConfig, IRoute, MfGeneratorOptions, MicroFrontendPluginOptions, RemoteConfig, RouteConfig, RoutesPluginOptions, RoutesTemplateOptions, VitePlugin };
|