import { mergeConfig, loadEnv } from 'vite';
import eslint from 'vite-plugin-eslint';
import baseConfig from './vite.config.base';

const env = loadEnv('development', process.cwd(), '');

export default mergeConfig(
  {
    mode: 'development',
    server: {
      port: 8163,
      open: false,
      fs: {
        strict: true,
      },
      proxy: {
        '/api/': env.VUE_APP_DEV_PROXY,
      },
      hmr: {
        overlay: false,
      },
    },
    plugins: [
      eslint({
        cache: false,
        include: ['src/**/*.ts', 'src/**/*.tsx', 'src/**/*.vue'],
        exclude: ['node_modules'],
      }),
    ],
  },
  baseConfig
);
