@dlzn-ui/vite-config 2.0.0 → 2.0.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.
Files changed (2) hide show
  1. package/dist/index.mjs +9 -11
  2. package/package.json +3 -3
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import path, { basename, resolve, relative, posix } from 'node:path';
2
2
  import AutoImport from 'unplugin-auto-import/vite';
3
3
  import Components from 'unplugin-vue-components/vite';
4
- import { loadEnv, mergeConfig } from 'vite';
4
+ import { normalizePath, loadEnv, mergeConfig } from 'vite';
5
5
  import { parseLoadedEnv } from 'vite-plugin-env-parse';
6
6
  import { createHtmlPlugin } from 'vite-plugin-html';
7
7
  import VueRouter from 'vue-router/vite';
@@ -118,20 +118,18 @@ const tDesignAutoImportResolve = (options) => {
118
118
  library: "vue-next",
119
119
  resolveIcons: false
120
120
  // 禁用 https://tdesign.tencent.com/icons TDesign 图标独立站点 的图标
121
- }).resolve(name);
121
+ }).find((item) => item.type === "component")?.resolve(name);
122
122
  return result;
123
123
  },
124
124
  type: "component"
125
125
  },
126
126
  {
127
127
  resolve: (name) => {
128
- if (name === "Loading") {
129
- return {
130
- // from: isProduction ? 'tdesign-vue-next' : '@/plugins/tdesign-vue-next-for-dev',
131
- from: "tdesign-vue-next",
132
- name: "LoadingDirective"
133
- };
134
- }
128
+ return TDesignResolver({
129
+ library: "vue-next",
130
+ resolveIcons: false
131
+ // 禁用 https://tdesign.tencent.com/icons TDesign 图标独立站点 的图标
132
+ }).find((item) => item.type === "directive")?.resolve(name);
135
133
  },
136
134
  type: "directive"
137
135
  }
@@ -154,13 +152,13 @@ const virtualAppParams = (options) => {
154
152
  if (id !== RESOLVED_ID) {
155
153
  return;
156
154
  }
157
- const userId = `/${relative(options.root, userFile).replace(/\\/g, "/")}`;
155
+ const userId = `/${normalizePath(relative(options.root, userFile))}`;
158
156
  return `
159
157
  import user from ${JSON.stringify(userId)}
160
158
 
161
159
  export default {
162
160
  ...user,
163
- // viewsEntryLazyImport: import.meta.glob(${JSON.stringify(viewsGlob)}),
161
+ viewsEntryLazyImport: import.meta.glob(${JSON.stringify(viewsGlob)}),
164
162
  }
165
163
  `;
166
164
  },
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dlzn-ui/vite-config",
3
3
  "type": "module",
4
- "version": "2.0.0",
4
+ "version": "2.0.2",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -22,7 +22,7 @@
22
22
  "dependencies": {
23
23
  "@plugin-web-update-notification/vite": "^2.1.3",
24
24
  "@tailwindcss/vite": "^4.3.3",
25
- "@tdesign-vue-next/auto-import-resolver": "^0.1.7",
25
+ "@tdesign-vue-next/auto-import-resolver": "^0.1.8",
26
26
  "@vitejs/plugin-vue": "^6.0.8",
27
27
  "@vitejs/plugin-vue-jsx": "^5.1.6",
28
28
  "browserslist": "^4.28.8",
@@ -37,7 +37,7 @@
37
37
  "vite-plugin-imagemin": "^0.6.1",
38
38
  "vite-plugin-vue-tailwind-auto-reference": "^2.0.2",
39
39
  "vue-router": "^5.2.0",
40
- "@dlzn-ui/node-utils": "2.0.0"
40
+ "@dlzn-ui/node-utils": "2.0.2"
41
41
  },
42
42
  "devDependencies": {
43
43
  "rimraf": "^6.1.3",