123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- import { defineConfig } from 'vite'
- import vue from '@vitejs/plugin-vue'
- import eslintPlugin from 'vite-plugin-eslint'
- // https://vitejs.dev/config/
- export default defineConfig(({ mode }) => {
- return {
- base: mode === 'production' ? '/' : '/',
- server: {
- host: '0.0.0.0',
- port: 9527,
- proxy: {
- '/api': {
- target: 'http://zohocrm.promocollection.com.au:9008/',
- changeOrigin: true,
- rewrite: (path) => path.replace(/^\/api/, ''),
- },
- // '/common': {
- // target: 'http://zohocrm.promocollection.com.au:9008/',
- // changeOrigin: true,
- // },
- // '/purchase_orders': {
- // target: 'http://zohocrm.promocollection.com.au:9008/',
- // changeOrigin: true,
- // },
- // '/Purchase_orders': {
- // target: 'http://zohocrm.promocollection.com.au:9008/',
- // changeOrigin: true,
- // },
- },
- },
- resolve: {
- alias: {
- '@': '/src/',
- },
- },
- css: {
- devSourcemap: true,
- preprocessorOptions: {
- scss: {
- additionalData: `@import '@/assets/css/flex-custom.scss';@import '@/assets/css/var.scss';`,
- },
- },
- },
- plugins: [vue(), eslintPlugin()],
- build: {
- // 设置最终构建的浏览器兼容目标
- target: 'es2015',
- // 构建后是否生成 source map 文件
- sourcemap: false,
- // chunk 大小警告的限制(以 kbs 为单位)
- chunkSizeWarningLimit: 1000,
- // 启用/禁用 gzip 压缩大小报告
- reportCompressedSize: false,
- },
- }
- })
|