dataControl/vite.config.js

49 lines
1.1 KiB
Vue
Raw Permalink Normal View History

2023-11-12 09:47:28 +08:00
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vitePluginImport from 'vite-plugin-babel-import';
import path from 'path'
2024-06-28 09:52:48 +08:00
import postCssPxToRem from "postcss-pxtorem";
2023-11-12 09:47:28 +08:00
const baseUrl = {
development: './',
beta: './',
release: './'
}
// https://vitejs.dev/config/
export default ({ mode }) => defineConfig({
plugins: [
vue()
],
base: baseUrl[mode],
resolve: {
alias: {
'~': path.resolve(__dirname, './'),
'@': path.resolve(__dirname, 'src')
}
},
2024-06-28 09:52:48 +08:00
css: {
postcss: {
plugins: [
postCssPxToRem({
rootValue: 192, // (设计稿/101rem的大小
propList: ["*"], // 除 border/font-size 外所有px 转 rem
})
]
},
},
2023-11-12 09:47:28 +08:00
server: {
proxy: {
'/api': {
2024-04-09 09:08:15 +08:00
// target: 'http://cdcm_test_api.shikicc.com:58909',
2024-01-20 21:48:14 +08:00
// target: 'http://frp.shikicc.com:58951',
2024-12-29 22:22:10 +08:00
target: 'http://cdcm_test_api.shikicc.com:8900',
2024-10-24 11:12:13 +08:00
// target: 'https://cdcm_api.shikicc.com',
2024-10-23 17:21:26 +08:00
// target: 'http://localhost:8088',
2023-11-12 09:47:28 +08:00
changeOrigin: true,
rewrite: path => path.replace(/^\/api/, '/api')
}
}
}
})