@dlzn-ui/vite-config 1.69.0 → 1.71.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.
Files changed (2) hide show
  1. package/dist/index.mjs +7 -40
  2. package/package.json +2 -2
package/dist/index.mjs CHANGED
@@ -15,6 +15,7 @@ import browserslist from 'browserslist';
15
15
  import { browserslistToTargets } from 'lightningcss';
16
16
  import tailwindAutoReference from 'vite-plugin-vue-tailwind-auto-reference';
17
17
  import { TDesignResolver } from '@tdesign-vue-next/auto-import-resolver';
18
+ import { kebabCase } from 'lodash-es';
18
19
  import { existsSync } from 'node:fs';
19
20
  import { webUpdateNotice } from '@plugin-web-update-notification/vite';
20
21
  import { visualizer } from 'rollup-plugin-visualizer';
@@ -75,6 +76,8 @@ const baseConfigFn = (options) => {
75
76
  };
76
77
  };
77
78
 
79
+ const optimizeDepsInclude = ["dlzn-ui/components/button", "dlzn-ui/components/card", "dlzn-ui/components/checkbox", "dlzn-ui/components/checkbox-group", "dlzn-ui/components/form", "dlzn-ui/components/icon", "dlzn-ui/components/image", "dlzn-ui/components/image-viewer", "dlzn-ui/components/input", "dlzn-ui/components/input-number", "dlzn-ui/components/link", "dlzn-ui/components/pagination", "dlzn-ui/components/popconfirm", "dlzn-ui/components/popup", "dlzn-ui/components/radio-group", "dlzn-ui/components/range-input", "dlzn-ui/components/select", "dlzn-ui/components/slider", "dlzn-ui/components/switch", "dlzn-ui/components/tab-panel", "dlzn-ui/components/tag", "dlzn-ui/components/tag-input", "dlzn-ui/components/textarea", "dlzn-ui/components/tree", "dlzn-ui/components/tree-select", "dlzn-ui/components/upload", "tdesign-vue-next/dist/tdesign.min.js", "path-browserify", "lodash-es", "pinia-plugin-persistedstate", "alova", "alova/fetch", "alova/vue", "@iconify/vue", "@formkit/auto-animate", "@formkit/auto-animate/vue", "dayjs", "dayjs/plugin/customParseFormat.js", "dayjs/plugin/isSameOrBefore.js", "wordcloud", "echarts/charts", "echarts/components", "echarts/core", "echarts/renderers", "@tdesign-vue-next/chat", "vue-echarts", "dompurify", "cron-parser", "cronstrue", "cronstrue/locales/zh_CN", "quartzcron", "@bprogress/core", "element-plus", "element-plus/es/components/config-provider/style/css", "element-plus/es/locale/lang/zh-cn", "element-plus/es/components/date-picker/style/css", "element-plus/es/components/scrollbar/style/css", "color"];
80
+
78
81
  const tDesignAutoImportResolve = (options) => {
79
82
  const { isProduction, root } = options;
80
83
  const tDesignResetComponentsSubFolderFiles = globSync("src/components/tDesignReset/*/Index.vue", {
@@ -94,7 +97,7 @@ const tDesignAutoImportResolve = (options) => {
94
97
  resolve: (name) => {
95
98
  if (["TCard"].includes(name)) {
96
99
  return {
97
- from: "dlzn-ui",
100
+ from: `dlzn-ui/components/${kebabCase(name.slice(1))}`,
98
101
  name
99
102
  };
100
103
  }
@@ -156,7 +159,7 @@ const tDesignAutoImportResolve = (options) => {
156
159
  const VIRTUAL_ID = "virtual:dlzn-ui/app-params";
157
160
  const RESOLVED_ID = `\0${VIRTUAL_ID}`;
158
161
  const virtualAppParams = (options) => {
159
- const userFile = resolve(options.root, options.appParamsFile ?? "app-params.ts");
162
+ const userFile = resolve(options.root, options.appParamsFile ?? "src/app-params.ts");
160
163
  const viewsGlob = options.viewsGlob ?? "@/views/**/index.vue";
161
164
  return {
162
165
  buildStart() {
@@ -177,7 +180,7 @@ const virtualAppParams = (options) => {
177
180
 
178
181
  export default {
179
182
  ...user,
180
- viewsEntryLazyImport: import.meta.glob(${JSON.stringify(viewsGlob)}),
183
+ // viewsEntryLazyImport: import.meta.glob(${JSON.stringify(viewsGlob)}),
181
184
  }
182
185
  `;
183
186
  },
@@ -448,43 +451,7 @@ const index = (_env, options) => {
448
451
  },
449
452
  // envDir, // 将 env 文件里面的变量注入到 import.meta.env 里面
450
453
  optimizeDeps: {
451
- exclude: ["dlzn-ui"],
452
- include: [
453
- "tdesign-vue-next/dist/tdesign.min.js",
454
- "path-browserify",
455
- "lodash-es",
456
- "pinia-plugin-persistedstate",
457
- "alova",
458
- "alova/fetch",
459
- "alova/vue",
460
- "@iconify/vue",
461
- "@formkit/auto-animate",
462
- "@formkit/auto-animate/vue",
463
- "dayjs",
464
- "dayjs/plugin/customParseFormat.js",
465
- "dayjs/plugin/isSameOrBefore.js",
466
- "dayjs/plugin/timezone.js",
467
- "dayjs/plugin/utc.js",
468
- "wordcloud",
469
- "echarts/charts",
470
- "echarts/components",
471
- "echarts/core",
472
- "echarts/renderers",
473
- "@tdesign-vue-next/chat",
474
- "vue-echarts",
475
- "dompurify",
476
- "cron-parser",
477
- "cronstrue",
478
- "cronstrue/locales/zh_CN",
479
- "quartzcron",
480
- "@bprogress/core",
481
- "element-plus",
482
- "element-plus/es/components/config-provider/style/css",
483
- "element-plus/es/locale/lang/zh-cn",
484
- "element-plus/es/components/date-picker/style/css",
485
- "element-plus/es/components/scrollbar/style/css",
486
- "color"
487
- ]
454
+ include: optimizeDepsInclude
488
455
  },
489
456
  plugins: [
490
457
  // envParse({
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dlzn-ui/vite-config",
3
3
  "type": "module",
4
- "version": "1.69.0",
4
+ "version": "1.71.0",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -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": "1.69.0"
40
+ "@dlzn-ui/node-utils": "1.71.0"
41
41
  },
42
42
  "devDependencies": {
43
43
  "rimraf": "^6.1.3",