@dlzn-ui/vite-config 1.90.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 -61
  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,40 +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
- "TTable",
122
- "TTabPanel",
123
- "TTag",
124
- "TTagInput",
125
- "TTextarea",
126
- "TTree",
127
- "TTreeSelect",
128
- "TUpload"
129
- ].includes(name)) {
126
+ if (dirs.map((dir) => `T/${upperFirst$1(camelCase(dir))}`).includes(name)) {
130
127
  return {
131
128
  from: `dlzn-ui/components/${kebabCase(name.slice(1))}`,
132
129
  name
@@ -137,28 +134,12 @@ const tDesignAutoImportResolve = (options) => {
137
134
  )) {
138
135
  return;
139
136
  }
140
- if (tDesignResetComponentsSubFolderName.includes(name)) {
141
- return {
142
- from: `@/components/tDesignReset/${name}/Index.vue`,
143
- name: "default"
144
- };
145
- }
146
137
  if (autoImportComponentsSubFolderName.includes(name)) {
147
138
  return {
148
139
  from: `@/components/autoImport/${name}/Index.vue`,
149
140
  name: "default"
150
141
  };
151
142
  }
152
- if (tDesignResetComponentsSubFolderName.map((n) => {
153
- const sliceName = n.slice(1);
154
- return `_${sliceName === "Table" ? "EnhancedTable" : sliceName}`;
155
- }).includes(name)) {
156
- return {
157
- as: name,
158
- from: isProduction ? "tdesign-vue-next" : "@/plugins/tdesign-vue-next-for-dev",
159
- name: name.slice(1)
160
- };
161
- }
162
143
  const result = TDesignResolver({
163
144
  library: "vue-next",
164
145
  resolveIcons: false
@@ -480,7 +461,7 @@ const index = (_env, options) => {
480
461
  },
481
462
  // envDir, // 将 env 文件里面的变量注入到 import.meta.env 里面
482
463
  optimizeDeps: {
483
- 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/table", "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
484
465
  },
485
466
  plugins: [
486
467
  // envParse({
@@ -537,17 +518,17 @@ const index = (_env, options) => {
537
518
  imports: ["useRequest", "useWatcher", "usePagination"]
538
519
  },
539
520
  {
540
- from: "@/components/tDesignReset/TForm/index.ts",
521
+ from: "dlzn-ui/components/form",
541
522
  imports: ["FormItem", "FormInstance", "FormExposed"],
542
523
  type: true
543
524
  },
544
525
  {
545
- from: "@/components/tDesignReset/TTable/index.ts",
526
+ from: "dlzn-ui/components/table",
546
527
  imports: ["TableCol", "CellRenderContext"],
547
528
  type: true
548
529
  },
549
530
  {
550
- from: "@/components/autoImport/TPageList/index.ts",
531
+ from: "dlzn-ui/components/page-list",
551
532
  imports: ["PageListProps"],
552
533
  type: true
553
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.90.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.90.0"
41
+ "@dlzn-ui/node-utils": "1.91.0"
42
42
  },
43
43
  "devDependencies": {
44
44
  "rimraf": "^6.1.3",