dlzn-ui 1.33.0 → 1.34.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.
- package/node/vite-config.d.ts +4 -1
- package/node/vite-config.mjs +7 -5
- package/package.json +1 -1
package/node/vite-config.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { ConfigEnv, UserConfig } from 'vite';
|
|
2
|
+
interface Options {
|
|
3
|
+
root: string;
|
|
4
|
+
}
|
|
2
5
|
export declare function commonConfig(_env: ConfigEnv): UserConfig;
|
|
3
|
-
declare const _default: (_env: ConfigEnv) => UserConfig;
|
|
6
|
+
declare const _default: (_env: ConfigEnv, options: Options) => UserConfig;
|
|
4
7
|
export default _default;
|
package/node/vite-config.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { needPort } from "./utils/index.mjs";
|
|
2
|
-
import { posix } from "node:path";
|
|
2
|
+
import { posix, resolve } from "node:path";
|
|
3
3
|
import tailwindcss from "@tailwindcss/vite";
|
|
4
4
|
import vue from "@vitejs/plugin-vue";
|
|
5
5
|
import browserslist from "browserslist";
|
|
@@ -22,8 +22,10 @@ function bypass(req, res, options) {
|
|
|
22
22
|
res.setHeader("X-Res-ProxyUrl", proxyUrl);
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
var vite_config_default = (_env) => {
|
|
25
|
+
var vite_config_default = (_env, options) => {
|
|
26
26
|
const { command, mode } = _env;
|
|
27
|
+
const { root } = options;
|
|
28
|
+
const resolvePath = (p) => resolve(root, p);
|
|
27
29
|
const { VITE_API_PROXY_PORT_ARRAY, VITE_APP_ID, VITE_APP_NAME = "", VITE_BASE_URL = "/", VITE_FORCE_PWD_CHANGE = true, VITE_PROXY_TARGET: viteProxyTarget, VITE_USE_LOGIN_CAPTCHA = true } = parseLoadedEnv(loadEnv(mode, "build/env"));
|
|
28
30
|
const VITE_PROXY_TARGET = Array.isArray(viteProxyTarget) ? viteProxyTarget : [viteProxyTarget];
|
|
29
31
|
console.log({
|
|
@@ -113,15 +115,15 @@ var vite_config_default = (_env) => {
|
|
|
113
115
|
alias: [
|
|
114
116
|
{
|
|
115
117
|
find: "@",
|
|
116
|
-
replacement: "src"
|
|
118
|
+
replacement: resolvePath("src")
|
|
117
119
|
},
|
|
118
120
|
{
|
|
119
121
|
find: "img",
|
|
120
|
-
replacement: "src/assets/images"
|
|
122
|
+
replacement: resolvePath("src/assets/images")
|
|
121
123
|
},
|
|
122
124
|
...isProduction ? [] : [{
|
|
123
125
|
find: /^.*tdesign-vue-next[/\\]es[/\\].*\.css$/,
|
|
124
|
-
replacement: "src/plugins/tdesign-vue-next-for-dev/empty.css"
|
|
126
|
+
replacement: resolvePath("src/plugins/tdesign-vue-next-for-dev/empty.css")
|
|
125
127
|
}]
|
|
126
128
|
],
|
|
127
129
|
extensions: [
|