@dlzn-ui/vite-config 2.0.3 → 2.0.5

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 +10 -16
  2. package/package.json +2 -2
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
- import path, { basename, resolve, relative, posix } from 'node:path';
1
+ import path, { basename, resolve, posix } from 'node:path';
2
2
  import AutoImport from 'unplugin-auto-import/vite';
3
3
  import Components from 'unplugin-vue-components/vite';
4
- import { normalizePath, loadEnv, mergeConfig } from 'vite';
4
+ import { 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';
@@ -15,7 +15,6 @@ import { browserslistToTargets } from 'lightningcss';
15
15
  import tailwindAutoReference from 'vite-plugin-vue-tailwind-auto-reference';
16
16
  import { TDesignResolver } from '@tdesign-vue-next/auto-import-resolver';
17
17
  import { upperFirst as upperFirst$1, camelCase, kebabCase } from 'lodash-es';
18
- import { existsSync } from 'node:fs';
19
18
  import { webUpdateNotice } from '@plugin-web-update-notification/vite';
20
19
  import { visualizer } from 'rollup-plugin-visualizer';
21
20
  import { compression } from 'vite-plugin-compression2';
@@ -62,7 +61,7 @@ const baseConfigFn = (options) => {
62
61
  };
63
62
  };
64
63
 
65
- 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"];
64
+ const dirs$1 = ["app", "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"];
66
65
  const optimizeDepsInclude = [
67
66
  ...dirs$1.map((str) => `dlzn-ui/components/${str}`),
68
67
  "tdesign-vue-next/dist/tdesign.min.js",
@@ -85,7 +84,7 @@ const optimizeDepsInclude = [
85
84
  "dlzn-ui/store"
86
85
  ];
87
86
 
88
- 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"];
87
+ const dirs = ["app", "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"];
89
88
  const tDesignAutoImportResolve = (options) => {
90
89
  const { root } = options;
91
90
  const autoImportComponentsSubFolderFiles = globSync("src/components/autoImport/*/Index.vue", {
@@ -138,27 +137,22 @@ const tDesignAutoImportResolve = (options) => {
138
137
 
139
138
  const VIRTUAL_ID = "virtual:dlzn-ui/app-params";
140
139
  const RESOLVED_ID = `\0${VIRTUAL_ID}`;
141
- const virtualAppParams = (options) => {
142
- const userFile = resolve(options.root, options.appParamsFile ?? "src/app-params.ts");
143
- const viewsGlob = options.viewsGlob ?? "@/views/**/index.vue";
140
+ const virtualAppParams = () => {
144
141
  return {
145
- buildStart() {
146
- if (!existsSync(userFile)) {
147
- throw new Error(`[dlzn-ui] \u672A\u627E\u5230 ${userFile}`);
148
- }
149
- },
150
142
  enforce: "pre",
151
143
  load(id) {
152
144
  if (id !== RESOLVED_ID) {
153
145
  return;
154
146
  }
155
- const userId = `/${normalizePath(relative(options.root, userFile))}`;
156
147
  return `
157
- import user from ${JSON.stringify(userId)}
148
+ import user from "@/app-params.ts"
149
+ import layoutsEntryLazyImport from "@/layout/index.ts"
150
+ import viewsEntryLazyImport from "@/views/index.ts"
158
151
 
159
152
  export default {
153
+ layoutsEntryLazyImport,
154
+ viewsEntryLazyImport,
160
155
  ...user,
161
- viewsEntryLazyImport: import.meta.glob(${JSON.stringify(viewsGlob)}),
162
156
  }
163
157
  `;
164
158
  },
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.3",
4
+ "version": "2.0.5",
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": "2.0.3"
40
+ "@dlzn-ui/node-utils": "2.0.5"
41
41
  },
42
42
  "devDependencies": {
43
43
  "rimraf": "^6.1.3",