import tailwindcss from '@tailwindcss/vite';
import vue from '@vitejs/plugin-vue';
import { resolve } from 'path';
import { defineConfig } from 'vite';

export default defineConfig({
    build: {
        rollupOptions: {
            output: {
                chunkFileNames: 'static/assets/js/[name]-[hash].js',
                entryFileNames: 'static/assets/js/[name]-[hash].js',
                assetFileNames: 'static/assets/[ext]/[name]-[hash].[ext]',
            }
        }
    },
    base: "/admin",
    minify: true,
    sourceMap: true,
    plugins: [
        vue(),
        tailwindcss(),
    ],
    resolve: {
        alias: {
            '@': resolve(__dirname, 'src')
        }
    },
    server: {
        host: '0.0.0.0',
	allowedHosts: ['mp.jdwan.com'],
        port: 3000,
        open: true,
        proxy: {
            '/v1': 'http://localhost:8088',
        }
    }
});
