-
Notifications
You must be signed in to change notification settings - Fork 548
/
vite.config.ts
39 lines (38 loc) · 914 Bytes
/
vite.config.ts
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
import react from '@vitejs/plugin-react';
import Icons from 'unplugin-icons/vite';
import { defineConfig } from 'vite';
// https://vitejs.dev/config/
export default defineConfig({
define: {
// https://github.com/codesandbox/sandpack/pull/787#issuecomment-1450353368
'process.env.SANDPACK_BARE_COMPONENTS': 'false',
},
optimizeDeps: {
esbuildOptions: {
target: 'es2020',
},
},
plugins: [
react({
babel: {
plugins: [
'babel-plugin-macros',
[
'@emotion/babel-plugin-jsx-pragmatic',
{
export: 'jsx',
import: '__cssprop',
module: '@emotion/react',
},
],
['@babel/plugin-transform-react-jsx', { pragma: '__cssprop' }, 'twin.macro'],
],
},
}),
Icons({
compiler: 'jsx',
jsx: 'react',
scale: 1.2,
}),
],
});