42 lines
799 B
TypeScript
42 lines
799 B
TypeScript
|
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"],
|
||
|
},
|
||
|
});
|