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

export default defineConfig({
  plugins: [vue()],
  server: {
    host: '0.0.0.0', // 监听所有网络接口
    port: 5173,      // 默认端口
    strictPort: true // 如果端口被占用则退出
  },
  resolve: {
    alias: {
      '@': path.resolve(__dirname, './src'),
      find: /^@dataview\/datav-vue3$/,
      replacement: '@kjgl77/datav-vue3'
    }
  },
  optimizeDeps: {
    include: ['@kjgl77/datav-vue3']
  },
  css: {
    preprocessorOptions: {
      scss: {
        additionalData: `@use "@/assets/styles/main" as *;`
      }
    }
  }
})