-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.ts
42 lines (39 loc) · 1006 Bytes
/
rollup.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
40
41
42
import { RollupOptions } from 'rollup'
import replace from '@rollup/plugin-replace'
import typescript from '@rollup/plugin-typescript'
import json from '@rollup/plugin-json'
import pkg from './package.json'
const config: RollupOptions = {
input: 'src/main.tsx',
output: [
{ file: pkg.main, format: 'cjs' },
{ file: pkg.module, format: 'es' },
],
plugins: [
typescript(),
json(),
replace({
preventAssignment: true,
'process.env.NODE_ENV': JSON.stringify('production'),
}),
],
external: [
'react',
'react/jsx-runtime',
'react-dom/server',
'@emotion/react',
'@emotion/react/jsx-runtime',
'i18n-iso-countries',
'date-fns',
'date-fns/locale',
'crypto',
'axios',
'immer',
'immer-compose',
'simple-icons/icons',
],
onwarn: (err) => {
throw new Error(err.message)
},
}
export default config