-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
27 lines (26 loc) · 862 Bytes
/
vite.config.ts
File metadata and controls
27 lines (26 loc) · 862 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/// <reference types="vitest" />
import path from 'path';
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react-swc';
import svgr from 'vite-plugin-svgr';
module.exports = defineConfig({
plugins: [react(), svgr()],
test: {
globals: true,
environment: 'happy-dom',
setupFiles: ['./test/vitest-setup.ts'],
},
resolve: {
// Resolve random 'TypeError: Failed to fetch dynamically imported module' error
// @see https://github.com/storybookjs/storybook/issues/21610#issuecomment-1882417258
extensions: ['.mdx', '.mjs', '.js', '.ts', '.tsx'],
alias: [
{ find: '@', replacement: path.resolve(__dirname, 'src') },
{ find: '@@', replacement: path.resolve(__dirname) },
],
},
// Uncomment the server block below to fix the localhost port to 3000
// server: {
// port: 3000,
// },
});