32 lines
		
	
	
		
			826 B
		
	
	
	
		
			JavaScript
		
	
	
	
			
		
		
	
	
			32 lines
		
	
	
		
			826 B
		
	
	
	
		
			JavaScript
		
	
	
	
import { defineConfig } from 'vite'
 | 
						|
import uni from '@dcloudio/vite-plugin-uni'
 | 
						|
// import eslintPlugin from 'vite-plugin-eslint'
 | 
						|
// https://vitejs.dev/config/
 | 
						|
export default defineConfig({
 | 
						|
    plugins: [
 | 
						|
        uni(),
 | 
						|
        // eslintPlugin({
 | 
						|
        //   include: ['src/**/*.js', 'src/**/*.vue', 'src/*.js', 'src/*.vue']
 | 
						|
        // })
 | 
						|
    ],
 | 
						|
    css: {
 | 
						|
        preprocessorOptions: {
 | 
						|
            scss: {
 | 
						|
                api: 'modern-compiler', // or 'modern'
 | 
						|
            },
 | 
						|
        },
 | 
						|
    },
 | 
						|
    server: {
 | 
						|
        proxy: {
 | 
						|
            // 在此处编写代理规则
 | 
						|
            '/api': {
 | 
						|
                target: 'http://192.168.2.246:18080',
 | 
						|
                changeOrigin: true,
 | 
						|
                rewrite: (path) => {
 | 
						|
                    return path.replace(/\/api/, '')
 | 
						|
                },
 | 
						|
            },
 | 
						|
        },
 | 
						|
    },
 | 
						|
})
 |