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 CHANGED
@@ -5,7 +5,7 @@ Befly Vite 配置预设和插件集合,专为 Vue 3 项目优化。
5
5
  ## 特性
6
6
 
7
7
  - ✅ 开箱即用的 Vite + Vue 3 配置
8
- - ✅ 集成常用插件(路由、自动导入、图标、UnoCSS 等)
8
+ - ✅ 集成常用插件(路由、自动导入、图标等)
9
9
  - ✅ 优化的构建配置(分包、压缩、分析)
10
10
  - ✅ 支持自定义扩展
11
11
 
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
- // befly-addon(必须在 Vue 判断之后)
70
- if (id.includes("@befly-addon/") || id.includes("packages/addonAdmin/") || id.includes("packages\\addonAdmin\\")) {
71
- return "befly-addon";
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.9",
4
- "gitHead": "b2a7116ecbf488ef3e7e74c5cb1da1ff33a64f2c",
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.0",
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"
@@ -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
@@ -1,8 +0,0 @@
1
- import UnoCSS from "unocss/vite";
2
-
3
- /**
4
- * 创建 UnoCSS 插件配置
5
- */
6
- export function createUnoCSSPlugin() {
7
- return UnoCSS();
8
- }
@@ -1,7 +0,0 @@
1
- /**
2
- * UnoCSS 配置创建函数(对外稳定导出)
3
- *
4
- * 注意:befly-vite 不再从主入口导出 configs/plugins,统一通过 utils 子路径导入。
5
- */
6
-
7
- export { createUnoConfig } from "../configs/uno.config.js";