befly-vite 1.34.0 → 1.36.0
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 +0 -15
- package/index.js +0 -6
- package/package.json +1 -2
package/README.md
CHANGED
|
@@ -89,7 +89,6 @@ export default createBeflyViteConfig();
|
|
|
89
89
|
| 参数 | 类型 | 默认值 | 作用 |
|
|
90
90
|
| -------------- | -------------------- | --------------- | ---------------------------------------------------- |
|
|
91
91
|
| `root` | `string` | `process.cwd()` | 项目根目录,用于解析 `src`、扫描 `views` 和生成别名 |
|
|
92
|
-
| `devtool` | `boolean` | `false` | 是否启用 `vite-plugin-vue-devtools` |
|
|
93
92
|
| `analyzer` | `boolean` | `false` | 是否启用打包分析,并输出到 `<root>/temp/analyzer` |
|
|
94
93
|
| `resolvers` | `Object \| Object[]` | `undefined` | 追加到组件自动注册中的自定义 resolver |
|
|
95
94
|
| `manualChunks` | `Function \| Object` | `undefined` | 便捷写入 `build.rolldownOptions.output.manualChunks` |
|
|
@@ -116,20 +115,6 @@ export default createBeflyViteConfig({
|
|
|
116
115
|
});
|
|
117
116
|
```
|
|
118
117
|
|
|
119
|
-
#### devtool
|
|
120
|
-
|
|
121
|
-
开启后会额外注入 `vite-plugin-vue-devtools`。
|
|
122
|
-
|
|
123
|
-
```javascript
|
|
124
|
-
import { createBeflyViteConfig } from "befly-vite";
|
|
125
|
-
|
|
126
|
-
export default createBeflyViteConfig({
|
|
127
|
-
devtool: true
|
|
128
|
-
});
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
适合:本地调试组件树、路由和状态。
|
|
132
|
-
|
|
133
118
|
#### analyzer
|
|
134
119
|
|
|
135
120
|
开启后会额外注入 `vite-bundle-analyzer`,并把报告输出到项目的 `temp/analyzer`。
|
package/index.js
CHANGED
|
@@ -7,7 +7,6 @@ import { TDesignResolver } from "unplugin-vue-components/resolvers";
|
|
|
7
7
|
import Components from "unplugin-vue-components/vite";
|
|
8
8
|
import { defineConfig, mergeConfig } from "vite";
|
|
9
9
|
import bundleAnalyzer from "vite-bundle-analyzer";
|
|
10
|
-
import VueDevTools from "vite-plugin-vue-devtools";
|
|
11
10
|
import VueRouter from "vue-router/vite";
|
|
12
11
|
|
|
13
12
|
const COMPONENTS_EXCLUDE = [/[\\/]node_modules[\\/](?!(?:.*[\\/])?befly-admin-ui[\\/])/];
|
|
@@ -61,7 +60,6 @@ function createComponentsPlugin(options = {}) {
|
|
|
61
60
|
* 创建 Befly Vite 配置
|
|
62
61
|
* @param {Object} options - 配置选项
|
|
63
62
|
* @param {string} options.root - 项目根目录(可选)
|
|
64
|
-
* @param {boolean} options.devtool - 是否启用 vite-plugin-vue-devtools(可选,默认 false)
|
|
65
63
|
* @param {boolean} options.analyzer - 是否启用 vite-bundle-analyzer(可选,默认 false)
|
|
66
64
|
* @param {Object|Object[]} options.resolvers - 自定义组件 resolvers(可选)
|
|
67
65
|
* @param {Function|Object} options.manualChunks - 便捷分包配置,会写入 build.rolldownOptions.output.manualChunks(可选)
|
|
@@ -72,7 +70,6 @@ export function createBeflyViteConfig(options = {}) {
|
|
|
72
70
|
const {
|
|
73
71
|
//
|
|
74
72
|
root,
|
|
75
|
-
devtool = false,
|
|
76
73
|
analyzer = false,
|
|
77
74
|
resolvers,
|
|
78
75
|
manualChunks,
|
|
@@ -104,9 +101,6 @@ export function createBeflyViteConfig(options = {}) {
|
|
|
104
101
|
}
|
|
105
102
|
})
|
|
106
103
|
);
|
|
107
|
-
if (devtool) {
|
|
108
|
-
plugins.push(VueDevTools());
|
|
109
|
-
}
|
|
110
104
|
plugins.push(createComponentsPlugin({ resolvers: resolvers }));
|
|
111
105
|
if (analyzer) {
|
|
112
106
|
plugins.push(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "befly-vite",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.36.0",
|
|
4
4
|
"gitHead": "282f7accca9c8d55956a5490c0365cce4a1ad90d",
|
|
5
5
|
"private": false,
|
|
6
6
|
"description": "Befly Vite 配置预设和插件集合",
|
|
@@ -42,7 +42,6 @@
|
|
|
42
42
|
"unplugin-vue-components": "^32.1.0",
|
|
43
43
|
"vite": "^8.0.16",
|
|
44
44
|
"vite-bundle-analyzer": "^1.3.8",
|
|
45
|
-
"vite-plugin-vue-devtools": "^8.1.2",
|
|
46
45
|
"vue-router": "^5.1.0"
|
|
47
46
|
},
|
|
48
47
|
"engines": {
|