You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.1 KiB
45 lines
1.1 KiB
import { defineConfig, loadEnv } from "vite";
|
|
import uni from "@dcloudio/vite-plugin-uni";
|
|
import pkg from "./package.json";
|
|
|
|
export default defineConfig(({ mode }) => {
|
|
const env = loadEnv(mode, __dirname);
|
|
// console.log(env);
|
|
return {
|
|
build: {
|
|
minify: "terser",
|
|
terserOptions: {
|
|
compress: {
|
|
// 移除console
|
|
drop_console: false,
|
|
drop_debugger: true,
|
|
},
|
|
},
|
|
},
|
|
define: {
|
|
__APP_INFO__: JSON.stringify({
|
|
pkg,
|
|
buildTimestamp: Date.now(),
|
|
}),
|
|
},
|
|
plugins: [uni()],
|
|
server: {
|
|
port: Number.parseInt(env.VITE_APP_PORT, 10),
|
|
proxy: {
|
|
['/jsonrpc']: {
|
|
changeOrigin: true,
|
|
target: 'https://lift-drawing-h5.ruixininfo.com',
|
|
// target: 'https://lift-h5.shulinelev.com',
|
|
// target: 'https://lift-drawing.ruixininfo.com',
|
|
},
|
|
['/api/proxyDownload']: {
|
|
changeOrigin: true,
|
|
target: 'https://lift-drawing-h5.ruixininfo.com',
|
|
// target: 'https://lift-h5.shulinelev.com',
|
|
// target: 'https://lift-drawing.ruixininfo.com',
|
|
},
|
|
},
|
|
},
|
|
};
|
|
});
|