@dlzn-ui/vite-config 1.96.0 → 1.98.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/dist/index.mjs +2 -18
- package/package.json +2 -3
package/dist/index.mjs
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import path, { basename, resolve, relative, posix } from 'node:path';
|
|
2
2
|
import AutoImport from 'unplugin-auto-import/vite';
|
|
3
|
-
import ElementPlus from 'unplugin-element-plus/vite';
|
|
4
3
|
import Components from 'unplugin-vue-components/vite';
|
|
5
4
|
import { loadEnv, mergeConfig } from 'vite';
|
|
6
5
|
import { parseLoadedEnv } from 'vite-plugin-env-parse';
|
|
7
6
|
import { createHtmlPlugin } from 'vite-plugin-html';
|
|
8
7
|
import VueRouter from 'vue-router/vite';
|
|
9
|
-
import { globSync } from 'tinyglobby';
|
|
10
8
|
import { upperFirst } from '@dlzn-ui/node-utils';
|
|
9
|
+
import { globSync } from 'tinyglobby';
|
|
11
10
|
import tailwindcss from '@tailwindcss/vite';
|
|
12
11
|
import vue from '@vitejs/plugin-vue';
|
|
13
12
|
import vueJsx from '@vitejs/plugin-vue-jsx';
|
|
@@ -23,19 +22,6 @@ import { compression } from 'vite-plugin-compression2';
|
|
|
23
22
|
import viteImagemin from 'vite-plugin-imagemin';
|
|
24
23
|
import fs from 'node:fs/promises';
|
|
25
24
|
|
|
26
|
-
const aliasElementPlus = (root) => {
|
|
27
|
-
const elementPlusCss = globSync("src/plugins/element-plus/theme-chalk/*.css", { cwd: root });
|
|
28
|
-
const arr = [];
|
|
29
|
-
elementPlusCss.forEach((file) => {
|
|
30
|
-
const _basename = basename(file);
|
|
31
|
-
arr.push({
|
|
32
|
-
find: `element-plus/theme-chalk/${_basename}`,
|
|
33
|
-
replacement: resolve(root, `src/plugins/element-plus/theme-chalk/${_basename}`)
|
|
34
|
-
});
|
|
35
|
-
});
|
|
36
|
-
return arr;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
25
|
const autoImportStoreList = (root) => {
|
|
40
26
|
const piniaStoreKeys = [];
|
|
41
27
|
const files = globSync("src/store/modules/*.ts", { cwd: root });
|
|
@@ -490,7 +476,6 @@ const index = (_env, options) => {
|
|
|
490
476
|
VueRouter({
|
|
491
477
|
dts: "types/typed-router.d.ts"
|
|
492
478
|
}),
|
|
493
|
-
ElementPlus({}),
|
|
494
479
|
AutoImport({
|
|
495
480
|
// 用于自动导入 函数/工具库 的 API
|
|
496
481
|
// function modifyDefaultExportsAlias(imports, options) {
|
|
@@ -579,8 +564,7 @@ const index = (_env, options) => {
|
|
|
579
564
|
find: /^.*tdesign-vue-next[/\\]es[/\\].*\.css$/,
|
|
580
565
|
replacement: resolvePath("src/plugins/tdesign-vue-next-for-dev/empty.css")
|
|
581
566
|
}
|
|
582
|
-
]
|
|
583
|
-
...aliasElementPlus(options.root)
|
|
567
|
+
]
|
|
584
568
|
],
|
|
585
569
|
// https://cn.vitejs.dev/guide/performance.html#reduce-resolve-operations
|
|
586
570
|
// 不建议忽略自定义导入类型的扩展名(例如:.vue),因为它会影响 IDE 和类型支持。
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dlzn-ui/vite-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.98.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -29,7 +29,6 @@
|
|
|
29
29
|
"rollup-plugin-visualizer": "^7.1.1",
|
|
30
30
|
"tinyglobby": "^0.2.17",
|
|
31
31
|
"unplugin-auto-import": "^21.1.0",
|
|
32
|
-
"unplugin-element-plus": "^0.11.2",
|
|
33
32
|
"unplugin-macros": "^0.23.2",
|
|
34
33
|
"unplugin-vue-components": "^32.1.0",
|
|
35
34
|
"vite-plugin-compression2": "^2.5.3",
|
|
@@ -38,7 +37,7 @@
|
|
|
38
37
|
"vite-plugin-imagemin": "^0.6.1",
|
|
39
38
|
"vite-plugin-vue-tailwind-auto-reference": "^2.0.2",
|
|
40
39
|
"vue-router": "^5.2.0",
|
|
41
|
-
"@dlzn-ui/node-utils": "1.
|
|
40
|
+
"@dlzn-ui/node-utils": "1.98.0"
|
|
42
41
|
},
|
|
43
42
|
"devDependencies": {
|
|
44
43
|
"rimraf": "^6.1.3",
|