import { fileURLToPath } from 'node:url'; import react from '@vitejs/plugin-react'; import { defineConfig } from 'vite'; export default defineConfig(({ mode }) => ({ plugins: [react()], resolve: { alias: mode === 'test' ? [ { find: /^animal-island-ui$/u, replacement: fileURLToPath( new URL('./node_modules/animal-island-ui/dist/cjs/index.cjs', import.meta.url), ), }, ] : [], }, }));