text: /* eslint-env node */
  
  import {chrome} from '../../electron-vendors.config.json';
  import {join} from 'path';
  import {builtinModules} from 'module';
  
  const PACKAGE_ROOT = __dirname;
  
  /**
   * @type {import('vite').UserConfig}
   * @see https://vitejs.dev/config/
   */
  const config = {
    mode: process.env.MODE,
    root: PACKAGE_ROOT,
    resolve: {
      alias: {
        '/@/': join(PACKAGE_ROOT, 'src') + '/',
      },
    },
    plugins: [],
    base: '',
    server: {
      fs: {
        strict: true,
      },
    },
    build: {
      sourcemap: true,
      target: `chrome${chrome}`,
      outDir: 'dist',
      assetsDir: '.',
      rollupOptions: {
        external: [
          ...builtinModules.filter(m => m !== 'process' && m !== 'assert'),
        ],
      },
      emptyOutDir: true,
      brotliSize: false,
    },
  };
  
  export default config;
  