@pubinfo/vite 2.0.0-rc.1 → 2.0.0-rc.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 +16 -0
- package/dist/index.js +8 -1
- package/package.json +2 -1
package/dist/index.d.ts
CHANGED
|
@@ -7,12 +7,28 @@ export * from "vite-plugin-fake-server/client";
|
|
|
7
7
|
//#region src/plugins/lib-resolver.d.ts
|
|
8
8
|
type GlobInput = string;
|
|
9
9
|
interface ModuleEntries {
|
|
10
|
+
/**
|
|
11
|
+
* 图标文件
|
|
12
|
+
* @default "src/assets/icons/**\/*"
|
|
13
|
+
*/
|
|
14
|
+
icons?: GlobInput;
|
|
15
|
+
/**
|
|
16
|
+
* 布局文件
|
|
17
|
+
* @default "src/layouts/**\/*"
|
|
18
|
+
*/
|
|
10
19
|
layouts?: GlobInput;
|
|
20
|
+
/**
|
|
21
|
+
* 页面文件
|
|
22
|
+
* @default "src/pages/**\/*"
|
|
23
|
+
*/
|
|
11
24
|
pages?: GlobInput;
|
|
12
25
|
}
|
|
13
26
|
interface ResolverPluginOptions {
|
|
27
|
+
/** 入口配置 */
|
|
14
28
|
entries: ModuleEntries;
|
|
29
|
+
/** 启用缓存优化 */
|
|
15
30
|
cache?: boolean;
|
|
31
|
+
/** 最大缓存大小 */
|
|
16
32
|
maxCacheSize?: number;
|
|
17
33
|
}
|
|
18
34
|
//#endregion
|
package/dist/index.js
CHANGED
|
@@ -14,6 +14,7 @@ import compression from "vite-plugin-compression";
|
|
|
14
14
|
import dts from "vite-plugin-dts";
|
|
15
15
|
import Icons from "unplugin-icons/vite";
|
|
16
16
|
import boxen from "boxen";
|
|
17
|
+
import { libInjectCss } from "vite-plugin-lib-inject-css";
|
|
17
18
|
import VueDevTools from "vite-plugin-vue-devtools";
|
|
18
19
|
import vueLegacy from "@vitejs/plugin-legacy";
|
|
19
20
|
import { createHash } from "node:crypto";
|
|
@@ -191,6 +192,12 @@ function appInfo() {
|
|
|
191
192
|
};
|
|
192
193
|
}
|
|
193
194
|
|
|
195
|
+
//#endregion
|
|
196
|
+
//#region src/plugins/inject-css.ts
|
|
197
|
+
function createInjectCSS() {
|
|
198
|
+
return libInjectCss();
|
|
199
|
+
}
|
|
200
|
+
|
|
194
201
|
//#endregion
|
|
195
202
|
//#region src/plugins/inspector.ts
|
|
196
203
|
function createInspector(env) {
|
|
@@ -371,7 +378,7 @@ function createVitePlugins(viteEnv, isBuild = false, config, type) {
|
|
|
371
378
|
createOpenAPI(config.openapi),
|
|
372
379
|
createLibResolver(config.resolver),
|
|
373
380
|
appInfo(),
|
|
374
|
-
type === "module" ? [createDTS()] : null,
|
|
381
|
+
type === "module" ? [createDTS(), createInjectCSS()] : null,
|
|
375
382
|
isBuild ? createCompression(viteEnv) : null
|
|
376
383
|
];
|
|
377
384
|
return vitePlugins.filter(Boolean);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pubinfo/vite",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.0-rc.
|
|
4
|
+
"version": "2.0.0-rc.2",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
"vite-plugin-dts": "^4.5.4",
|
|
42
42
|
"vite-plugin-env-runtime": "^0.3.6",
|
|
43
43
|
"vite-plugin-fake-server": "^2.2.0",
|
|
44
|
+
"vite-plugin-lib-inject-css": "^2.2.2",
|
|
44
45
|
"vite-plugin-vue-devtools": "^8.0.0"
|
|
45
46
|
},
|
|
46
47
|
"devDependencies": {
|