import {defineConfig} from 'vite';
import uni from '@dcloudio/vite-plugin-uni';
import {UnifiedViteWeappTailwindcssPlugin} from 'weapp-tailwindcss/vite';
import tailwindcss from '@tailwindcss/postcss'

export default defineConfig({
    plugins: [
        uni.default({
            script: {
                defineModel: true,
            }
        }),
        UnifiedViteWeappTailwindcssPlugin({
            rem2rpx: true,
        })
    ],
    css: {
        postcss: {
            plugins: [tailwindcss()]
        }
    }, server: {
        proxy: {
            '/baseApi': {
                target: 'http://192.168.1.105', changeOrigin: true, rewrite: (path) => path.replace(/^\/baseApi/, ''),
            }
        }
    }
})
