moto-App/vite.config.ts

42 lines
799 B
TypeScript
Raw Permalink Normal View History

2023-12-08 17:39:09 +08:00
import { defineConfig } from "vite";
import { resolve } from "path"
import uni from "@dcloudio/vite-plugin-uni";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [uni()],
resolve: {
alias: [
{
find: "@",
replacement: resolve(__dirname, 'src')
}
]
},
css: {
preprocessorOptions: {
// 全局样式引入
scss: {
additionalData: '@import "./src/styles/variables.scss";',
javascriptEnabled: true
}
}
},
server: {
proxy: {
'/local': {
target: 'http://1.14.15.135:5610', // 172.16.8.98:5610
// target: 'https://6u18q42299.zicp.fun/ty-api',
changeOrigin: true,
rewrite: path => {
return path.replace(/^\/local/, '')
}
},
}
},
esbuild: {
// drop: ["console", "debugger"],
drop: ["debugger"],
},
});