-
Notifications
You must be signed in to change notification settings - Fork 83
/
vite.config.js
46 lines (44 loc) · 1.18 KB
/
vite.config.js
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import { defineConfig } from 'vite';
import reactRefresh from '@vitejs/plugin-react';
import svgrPlugin from 'vite-plugin-svgr';
import eslintPlugin from 'vite-plugin-eslint';
import {rehypeMetaAsAttributes} from "./src/lib/rehype-meta-as-attributes";
// https://vitejs.dev/config/
export default defineConfig(async () => {
const mdx = await import('@mdx-js/rollup');
return {
base: './',
// This changes the output dir from dist to build
// comment this out if that isn't relevant for your project
build: {
outDir: 'dist',
},
plugins: [
reactRefresh(),
svgrPlugin({
svgrOptions: {
icon: true,
// ...svgr options (https://react-svgr.com/docs/options/)
},
}),
eslintPlugin({
include: ['src/**/*.jsx', 'src/**/*.js', 'src/**/*.ts', 'src/**/*.tsx'],
exclude: [
'node_modules/**',
'dist/**, build/**',
'**/*.mdx',
'**/*.md'],
}),
mdx.default({
rehypePlugins: [
rehypeMetaAsAttributes,
],
}),
],
test: {
globals: true,
environment: 'jsdom',
setupFiles: ['./src/setupTests.js'],
},
}
});