Skip to content

Commit

Permalink
change
Browse files Browse the repository at this point in the history
  • Loading branch information
enddynayn committed Nov 1, 2024
1 parent f1993be commit 5da6c7d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ import { svelte } from '@sveltejs/vite-plugin-svelte';
import { resolve } from 'path';

// Why do the alias not work in vite.config.ts?
export default defineConfig({
export default defineConfig(({ mode }) => ({
plugins: [svelte({ hot: !process.env.VITEST })],
resolve: {
conditions: mode === 'test' ? ['browser'] : [],
alias: {
$lib: resolve(__dirname, 'src/lib'),
$components: resolve(__dirname, 'src/components'),
Expand All @@ -23,4 +24,4 @@ export default defineConfig({
include: ['src/**'],
},
},
});
}));

0 comments on commit 5da6c7d

Please sign in to comment.