@dlzn-ui/vite-config 2.0.4 → 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.
- package/dist/index.mjs +8 -14
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import path, { basename, resolve,
|
|
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 {
|
|
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';
|
|
@@ -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 = (
|
|
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
|
|
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.
|
|
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.
|
|
40
|
+
"@dlzn-ui/node-utils": "2.0.5"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"rimraf": "^6.1.3",
|