wlwy-package 4.0.0-beta.28 → 4.0.0-beta.29
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.
|
@@ -1,10 +1,24 @@
|
|
|
1
|
-
import type { Plugin } from 'vite';
|
|
2
1
|
export interface InjectPageShellOptions {
|
|
3
2
|
/** 挂载节点 id,默认 `app` */
|
|
4
3
|
id?: string;
|
|
5
4
|
}
|
|
5
|
+
/**
|
|
6
|
+
* Vite 插件外形(故意不引用 `vite` 的 `Plugin` 类型,避免业务项目与包内各一份 vite 时类型不兼容)。
|
|
7
|
+
*/
|
|
8
|
+
export interface InjectPageShellPlugin {
|
|
9
|
+
name: string;
|
|
10
|
+
transformIndexHtml: (html: string) => string | {
|
|
11
|
+
html: string;
|
|
12
|
+
tags: Array<{
|
|
13
|
+
tag: string;
|
|
14
|
+
injectTo: 'head';
|
|
15
|
+
attrs?: Record<string, string | boolean | undefined>;
|
|
16
|
+
children?: string;
|
|
17
|
+
}>;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
6
20
|
/**
|
|
7
21
|
* 把首屏静态骨架的 CSS 写入 head,HTML 插入挂载节点开口标签后,保留节点内已有内容。
|
|
8
22
|
*/
|
|
9
|
-
export declare function injectPageShell(options?: InjectPageShellOptions):
|
|
23
|
+
export declare function injectPageShell(options?: InjectPageShellOptions): InjectPageShellPlugin;
|
|
10
24
|
export default injectPageShell;
|