import {defineConfig} from 'vite'
import react from '@vitejs/plugin-react'

export default defineConfig({
  plugins: [react()],
  build: {
    // 禁用文件名哈希，强制浏览器重新加载
    rollupOptions: {
      output: {
        entryFileNames: `assets/[name].js`,
        chunkFileNames: `assets/[name].js`,
        assetFileNames: `assets/[name].[ext]`
      }
    }
  },
  server: {
    host: '0.0.0.0',
    port: 5174,
    // 开发服务器禁用缓存
    headers: {
      'Cache-Control': 'no-store',
    }
  }
})
