@lemon-fe/vite-plugin-micro-frontend 1.0.1 → 1.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 +43 -3
- package/dist/index.js +13 -1
- package/dist/index.js.map +1 -1
- package/dist/runtime.d.ts +19 -2
- package/dist/runtime.js +107 -38
- package/dist/runtime.js.map +1 -1
- package/package.json +7 -3
package/dist/index.d.ts
CHANGED
|
@@ -147,7 +147,7 @@ interface DynamicOptions<P = Record<string, unknown>> {
|
|
|
147
147
|
*
|
|
148
148
|
* @example
|
|
149
149
|
* ```tsx
|
|
150
|
-
* import { dynamic } from '@lemon-fe/vite-plugin-micro-frontend/
|
|
150
|
+
* import { dynamic } from '@lemon-fe/vite-plugin-micro-frontend/runtime';
|
|
151
151
|
*
|
|
152
152
|
* // 使用 dynamic
|
|
153
153
|
* const MyComponent = dynamic({
|
|
@@ -158,6 +158,46 @@ interface DynamicOptions<P = Record<string, unknown>> {
|
|
|
158
158
|
*/
|
|
159
159
|
declare function dynamic<P = Record<string, unknown>>(options: DynamicOptions<P>): ComponentType<P>;
|
|
160
160
|
|
|
161
|
+
type WithFalse<T> = {
|
|
162
|
+
[P in keyof T]?: T[P] | false;
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
interface BaseIConfig {
|
|
166
|
+
singular?: boolean;
|
|
167
|
+
outputPath?: string;
|
|
168
|
+
publicPath?: string;
|
|
169
|
+
title?: string;
|
|
170
|
+
mountElementId?: string;
|
|
171
|
+
routes?: IRoute[];
|
|
172
|
+
exportStatic?: {
|
|
173
|
+
htmlSuffix?: boolean;
|
|
174
|
+
dynamicRoot?: boolean;
|
|
175
|
+
supportWin?: boolean;
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
type IConfig = WithFalse<BaseIConfig>;
|
|
180
|
+
|
|
181
|
+
interface IRoute {
|
|
182
|
+
component?: any;
|
|
183
|
+
exact?: boolean;
|
|
184
|
+
path?: string;
|
|
185
|
+
routes?: IRoute[];
|
|
186
|
+
wrappers?: string[];
|
|
187
|
+
title?: string;
|
|
188
|
+
__toMerge?: boolean;
|
|
189
|
+
__isDynamic?: boolean;
|
|
190
|
+
[key: string]: any;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
interface IOpts {
|
|
194
|
+
root: string;
|
|
195
|
+
relDir?: string;
|
|
196
|
+
componentPrefix?: string;
|
|
197
|
+
config: IConfig;
|
|
198
|
+
}
|
|
199
|
+
declare function getRoutes(opts: IOpts): IRoute[];
|
|
200
|
+
|
|
161
201
|
/**
|
|
162
202
|
* 微前端插件集合
|
|
163
203
|
*
|
|
@@ -222,5 +262,5 @@ declare function microFrontendPlugins(options: MicroFrontendPluginOptions): Plug
|
|
|
222
262
|
*/
|
|
223
263
|
declare function createMfAlias(mfPath?: string): Record<string, string>;
|
|
224
264
|
|
|
225
|
-
export { createMfAlias, dynamic, htmlRemoveFreshPlugin, mfGeneratorPlugin, microFrontendPlugins, pagesRoutesPlugin };
|
|
226
|
-
export type { ComponentMetadata, DynamicOptions, FederationConfig, MfGeneratorOptions, MicroFrontendPluginOptions, RemoteConfig, RouteConfig, RoutesPluginOptions, RoutesTemplateOptions, VitePlugin };
|
|
265
|
+
export { createMfAlias, dynamic, getRoutes, htmlRemoveFreshPlugin, mfGeneratorPlugin, microFrontendPlugins, pagesRoutesPlugin };
|
|
266
|
+
export type { ComponentMetadata, DynamicOptions, FederationConfig, IRoute, MfGeneratorOptions, MicroFrontendPluginOptions, RemoteConfig, RouteConfig, RoutesPluginOptions, RoutesTemplateOptions, VitePlugin };
|