12345678910111213141516171819202122232425262728293031323334 |
- import { defineConfig } from 'vite'
- import vue from '@vitejs/plugin-vue'
- import path from 'path'
- // https://vite.dev/config/
- export default defineConfig({
- plugins: [ vue() ],
- css: {
- preprocessorOptions: {
- less: {
- // additionalData: `@import "@/styles/variables.less";`, // 替换为你的全局样式路径
- },
- },
- },
- server:{
- port:8080,
- host: '0.0.0.0', // 配置项目可以局域网访问
- cors: true, // 默认启用并允许任何源
- proxy: {
- '/alipay-ccm-robot': {
- target: 'https://test.hz-hanghui.com:18890',
- changeOrigin: true,
- rewrite: (path) => path.replace(/^\/api/, ''),
- },
- },
- },
- base: './', // 打包的静态资源引用路径
- resolve: {
- alias: {
- find: '@',
- replacement: path.resolve(__dirname, 'src')
- },
- },
- })
|