befly-vite 1.2.9 → 1.2.10
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/README.md +1 -1
- package/index.js +4 -11
- package/package.json +3 -6
- package/configs/uno.config.js +0 -37
- package/plugins/unocss.js +0 -8
- package/utils/createUnoConfig.js +0 -7
package/README.md
CHANGED
package/index.js
CHANGED
|
@@ -10,7 +10,6 @@ import { createDevToolsPlugin } from "./plugins/devtools.js";
|
|
|
10
10
|
import { createIconsPlugin } from "./plugins/icons.js";
|
|
11
11
|
import { createReactivityTransformPlugin } from "./plugins/reactivity-transform.js";
|
|
12
12
|
import { createRouterPlugin } from "./plugins/router.js";
|
|
13
|
-
import { createUnoCSSPlugin } from "./plugins/unocss.js";
|
|
14
13
|
import { createVuePlugin } from "./plugins/vue.js";
|
|
15
14
|
|
|
16
15
|
/**
|
|
@@ -66,15 +65,10 @@ function defaultManualChunks(id) {
|
|
|
66
65
|
return "vue-macros";
|
|
67
66
|
}
|
|
68
67
|
|
|
69
|
-
//
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
// 其他 node_modules 依赖
|
|
75
|
-
if (id.includes("node_modules/")) {
|
|
76
|
-
return "vendor";
|
|
77
|
-
}
|
|
68
|
+
// 注意:不要把所有 addon 或 node_modules 强制合并到单个 chunk。
|
|
69
|
+
// - addon 路由(importMode: async)应按页面懒加载自然拆分。
|
|
70
|
+
// - node_modules 让 Rollup 按共享与动态导入边界自动拆分即可。
|
|
71
|
+
// 如需进一步细分,可通过 createBeflyViteConfig({ manualChunks }) 注入自定义策略。
|
|
78
72
|
}
|
|
79
73
|
|
|
80
74
|
/**
|
|
@@ -98,7 +92,6 @@ export function createBeflyViteConfig(options = {}) {
|
|
|
98
92
|
|
|
99
93
|
plugins: [
|
|
100
94
|
//
|
|
101
|
-
createUnoCSSPlugin(),
|
|
102
95
|
createRouterPlugin({ scanViews: scanViews }),
|
|
103
96
|
createVuePlugin(),
|
|
104
97
|
createReactivityTransformPlugin(),
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "befly-vite",
|
|
3
|
-
"version": "1.2.
|
|
4
|
-
"gitHead": "
|
|
3
|
+
"version": "1.2.10",
|
|
4
|
+
"gitHead": "0767937b19f1179f156c0f4a9c4582945eeb0be0",
|
|
5
5
|
"private": false,
|
|
6
6
|
"description": "Befly Vite 配置预设和插件集合",
|
|
7
7
|
"keywords": [
|
|
@@ -37,17 +37,14 @@
|
|
|
37
37
|
"scanViewsDir": "bun ./bin/scanViewsDir.ts"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@unocss/preset-attributify": "^66.5.11",
|
|
41
|
-
"@unocss/preset-uno": "^66.5.11",
|
|
42
40
|
"@vitejs/plugin-vue": "^6.0.3",
|
|
43
41
|
"@vue-macros/reactivity-transform": "^3.1.1",
|
|
44
42
|
"befly-shared": "^1.3.8",
|
|
45
43
|
"sass": "^1.97.1",
|
|
46
|
-
"unocss": "^66.5.11",
|
|
47
44
|
"unplugin-auto-import": "^20.3.0",
|
|
48
45
|
"unplugin-icons": "^22.5.0",
|
|
49
46
|
"unplugin-vue-components": "^30.0.0",
|
|
50
|
-
"unplugin-vue-router": "^0.19.
|
|
47
|
+
"unplugin-vue-router": "^0.19.2",
|
|
51
48
|
"vite-bundle-analyzer": "^1.3.1",
|
|
52
49
|
"vite-plugin-compression2": "^2.4.0",
|
|
53
50
|
"vite-plugin-vue-devtools": "^8.0.5"
|
package/configs/uno.config.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { defineConfig, presetAttributify, presetUno } from "unocss";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* 创建 UnoCSS 配置
|
|
5
|
-
*/
|
|
6
|
-
export function createUnoConfig(userConfig = {}) {
|
|
7
|
-
const defaultConfig = {
|
|
8
|
-
presets: [presetUno(), presetAttributify()],
|
|
9
|
-
shortcuts: {
|
|
10
|
-
"flex-center": "flex items-center justify-center",
|
|
11
|
-
"flex-between": "flex items-center justify-between",
|
|
12
|
-
"flex-col-center": "flex flex-col items-center justify-center"
|
|
13
|
-
},
|
|
14
|
-
theme: {
|
|
15
|
-
colors: {
|
|
16
|
-
primary: "#1890ff",
|
|
17
|
-
success: "#52c41a",
|
|
18
|
-
warning: "#faad14",
|
|
19
|
-
danger: "#ff4d4f",
|
|
20
|
-
info: "#1890ff"
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
return defineConfig({
|
|
26
|
-
...defaultConfig,
|
|
27
|
-
...userConfig,
|
|
28
|
-
theme: {
|
|
29
|
-
...defaultConfig.theme,
|
|
30
|
-
...userConfig.theme
|
|
31
|
-
},
|
|
32
|
-
shortcuts: {
|
|
33
|
-
...defaultConfig.shortcuts,
|
|
34
|
-
...userConfig.shortcuts
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
}
|
package/plugins/unocss.js
DELETED