-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathrollup.config.js
51 lines (48 loc) · 1.2 KB
/
rollup.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
47
48
49
50
51
import { babel } from '@rollup/plugin-babel';
import image from '@rollup/plugin-image';
import replace from '@rollup/plugin-replace';
import postcss from 'rollup-plugin-postcss';
import pkg from './package.json';
const NODE_ENV = process.env.NODE_ENV ? process.env.NODE_ENV : 'development';
export default [
{
input: './src/index.js',
output: [
{
file: 'dist/index.js',
format: 'cjs'
},
{
file: 'dist/index.esm.js',
format: 'esm'
}
],
plugins: [
replace({
preventAssignment: true,
'process.env.NODE_ENV': JSON.stringify(NODE_ENV)
}),
babel({
exclude: 'node_modules/**'
}),
// autoExternal(),
image(),
postcss({
extensions: ['.css']
})
],
external: [
'react/jsx-runtime',
'react-icons/fa',
'react-icons/md',
'@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.css',
'react-icons/all',
'react-dom/server',
'theme-ui',
'theme-ui/jsx-runtime',
'@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw',
'@reach/menu-button/styles.css',
...Object.keys(pkg.dependencies).concat(Object.keys(pkg.peerDependencies))
]
}
];