-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathvite.config.js
41 lines (39 loc) · 1.03 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
/* eslint-disable import/no-extraneous-dependencies */
import { resolve } from 'node:path';
import react from '@vitejs/plugin-react';
import { defineConfig } from 'vite';
export default defineConfig({
plugins: [react()],
build: {
sourcemap: true,
lib: {
entry: resolve(__dirname, 'src/index.js'),
name: 'wui',
fileName: format => `wui.${format}.js`,
},
rollupOptions: {
external: [
'@emotion/react',
'@emotion/styled',
'@mui/icons-material',
'@mui/material',
'@mui/x-date-pickers',
'react',
'react-dom',
'react-hot-toast',
],
output: {
globals: {
react: 'React',
'react-dom': 'ReactDOM',
'@emotion/react': 'emotionReact',
'@emotion/styled': 'emotionStyled',
'@mui/material': 'MaterialUI',
'@mui/icons-material': 'MaterialUIIcons',
'@mui/x-date-pickers': 'MaterialUIXDatePickers',
'react-hot-toast': 'toast',
},
},
},
},
});