@dlzn-ui/vite-config 1.89.0 → 1.91.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 +42 -60
  2. package/package.json +2 -2
package/dist/index.mjs CHANGED
@@ -15,7 +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
+ import { upperFirst as upperFirst$1, camelCase, kebabCase } from 'lodash-es';
19
19
  import { existsSync } from 'node:fs';
20
20
  import { webUpdateNotice } from '@plugin-web-update-notification/vite';
21
21
  import { visualizer } from 'rollup-plugin-visualizer';
@@ -76,14 +76,44 @@ const baseConfigFn = (options) => {
76
76
  };
77
77
  };
78
78
 
79
+ const dirs$1 = ["button", "card", "checkbox", "checkbox-group", "cron", "custom-page-list", "custom-page-table", "date-picker", "form", "gradient-text", "icon", "image", "image-viewer", "input", "input-number", "link", "overview", "page-list", "page-query", "page-table", "pagination", "popconfirm", "popup", "provider", "radio-group", "range-input", "scrollbar", "select", "select-sys-user", "slider", "switch", "tab-panel", "table", "tag", "tag-input", "textarea", "tree", "tree-select", "upload"];
80
+ const optimizeDepsInclude = [
81
+ ...dirs$1.map((str) => `dlzn-ui/components/${str}`),
82
+ "tdesign-vue-next/dist/tdesign.min.js",
83
+ "path-browserify",
84
+ "lodash-es",
85
+ "alova",
86
+ "alova/fetch",
87
+ "alova/vue",
88
+ "@formkit/auto-animate",
89
+ "@formkit/auto-animate/vue",
90
+ "dayjs",
91
+ "dayjs/plugin/customParseFormat.js",
92
+ "dayjs/plugin/isSameOrBefore.js",
93
+ "wordcloud",
94
+ "echarts/charts",
95
+ "echarts/components",
96
+ "echarts/core",
97
+ "echarts/renderers",
98
+ "@tdesign-vue-next/chat",
99
+ "vue-echarts",
100
+ "dompurify",
101
+ "cron-parser",
102
+ "cronstrue",
103
+ "cronstrue/locales/zh_CN",
104
+ "quartzcron",
105
+ "@bprogress/core",
106
+ "element-plus",
107
+ "element-plus/es/components/config-provider/style/css",
108
+ "element-plus/es/locale/lang/zh-cn",
109
+ "element-plus/es/components/date-picker/style/css",
110
+ "element-plus/es/components/scrollbar/style/css",
111
+ "color"
112
+ ];
113
+
114
+ const dirs = ["button", "card", "checkbox", "checkbox-group", "cron", "custom-page-list", "custom-page-table", "date-picker", "form", "gradient-text", "icon", "image", "image-viewer", "input", "input-number", "link", "overview", "page-list", "page-query", "page-table", "pagination", "popconfirm", "popup", "provider", "radio-group", "range-input", "scrollbar", "select", "select-sys-user", "slider", "switch", "tab-panel", "table", "tag", "tag-input", "textarea", "tree", "tree-select", "upload"];
79
115
  const tDesignAutoImportResolve = (options) => {
80
116
  const { isProduction, root } = options;
81
- const tDesignResetComponentsSubFolderFiles = globSync("src/components/tDesignReset/*/Index.vue", {
82
- cwd: root
83
- });
84
- const tDesignResetComponentsSubFolderName = tDesignResetComponentsSubFolderFiles.map((file) => {
85
- return path.basename(path.dirname(file));
86
- });
87
117
  const autoImportComponentsSubFolderFiles = globSync("src/components/autoImport/*/Index.vue", {
88
118
  cwd: root
89
119
  });
@@ -93,39 +123,7 @@ const tDesignAutoImportResolve = (options) => {
93
123
  return [
94
124
  {
95
125
  resolve: (name) => {
96
- if ([
97
- "TButton",
98
- "TCard",
99
- "TCheckbox",
100
- "TCheckboxGroup",
101
- "TCron",
102
- "TDatePicker",
103
- "TGradientText",
104
- "TIcon",
105
- "TImage",
106
- "TImageViewer",
107
- "TInput",
108
- "TInputNumber",
109
- "TLink",
110
- "TPageQuery",
111
- "TPagination",
112
- "TPopconfirm",
113
- "TPopup",
114
- "TProvider",
115
- "TRadioGroup",
116
- "TRangeInput",
117
- "TScrollbar",
118
- "TSelect",
119
- "TSlider",
120
- "TSwitch",
121
- "TTabPanel",
122
- "TTag",
123
- "TTagInput",
124
- "TTextarea",
125
- "TTree",
126
- "TTreeSelect",
127
- "TUpload"
128
- ].includes(name)) {
126
+ if (dirs.map((dir) => `T/${upperFirst$1(camelCase(dir))}`).includes(name)) {
129
127
  return {
130
128
  from: `dlzn-ui/components/${kebabCase(name.slice(1))}`,
131
129
  name
@@ -136,28 +134,12 @@ const tDesignAutoImportResolve = (options) => {
136
134
  )) {
137
135
  return;
138
136
  }
139
- if (tDesignResetComponentsSubFolderName.includes(name)) {
140
- return {
141
- from: `@/components/tDesignReset/${name}/Index.vue`,
142
- name: "default"
143
- };
144
- }
145
137
  if (autoImportComponentsSubFolderName.includes(name)) {
146
138
  return {
147
139
  from: `@/components/autoImport/${name}/Index.vue`,
148
140
  name: "default"
149
141
  };
150
142
  }
151
- if (tDesignResetComponentsSubFolderName.map((n) => {
152
- const sliceName = n.slice(1);
153
- return `_${sliceName === "Table" ? "EnhancedTable" : sliceName}`;
154
- }).includes(name)) {
155
- return {
156
- as: name,
157
- from: isProduction ? "tdesign-vue-next" : "@/plugins/tdesign-vue-next-for-dev",
158
- name: name.slice(1)
159
- };
160
- }
161
143
  const result = TDesignResolver({
162
144
  library: "vue-next",
163
145
  resolveIcons: false
@@ -479,7 +461,7 @@ const index = (_env, options) => {
479
461
  },
480
462
  // envDir, // 将 env 文件里面的变量注入到 import.meta.env 里面
481
463
  optimizeDeps: {
482
- include: ["dlzn-ui/components/button", "dlzn-ui/components/card", "dlzn-ui/components/checkbox", "dlzn-ui/components/checkbox-group", "dlzn-ui/components/cron", "dlzn-ui/components/date-picker", "dlzn-ui/components/form", "dlzn-ui/components/gradient-text", "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/page-query", "dlzn-ui/components/pagination", "dlzn-ui/components/popconfirm", "dlzn-ui/components/popup", "dlzn-ui/components/provider", "dlzn-ui/components/radio-group", "dlzn-ui/components/range-input", "dlzn-ui/components/scrollbar", "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", "alova", "alova/fetch", "alova/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"]
464
+ include: optimizeDepsInclude
483
465
  },
484
466
  plugins: [
485
467
  // envParse({
@@ -536,17 +518,17 @@ const index = (_env, options) => {
536
518
  imports: ["useRequest", "useWatcher", "usePagination"]
537
519
  },
538
520
  {
539
- from: "@/components/tDesignReset/TForm/index.ts",
521
+ from: "dlzn-ui/components/form",
540
522
  imports: ["FormItem", "FormInstance", "FormExposed"],
541
523
  type: true
542
524
  },
543
525
  {
544
- from: "@/components/tDesignReset/TTable/index.ts",
526
+ from: "dlzn-ui/components/table",
545
527
  imports: ["TableCol", "CellRenderContext"],
546
528
  type: true
547
529
  },
548
530
  {
549
- from: "@/components/autoImport/TPageList/index.ts",
531
+ from: "dlzn-ui/components/page-list",
550
532
  imports: ["PageListProps"],
551
533
  type: true
552
534
  },
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dlzn-ui/vite-config",
3
3
  "type": "module",
4
- "version": "1.89.0",
4
+ "version": "1.91.0",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -38,7 +38,7 @@
38
38
  "vite-plugin-imagemin": "^0.6.1",
39
39
  "vite-plugin-vue-tailwind-auto-reference": "^2.0.2",
40
40
  "vue-router": "^5.2.0",
41
- "@dlzn-ui/node-utils": "1.89.0"
41
+ "@dlzn-ui/node-utils": "1.91.0"
42
42
  },
43
43
  "devDependencies": {
44
44
  "rimraf": "^6.1.3",