-
Notifications
You must be signed in to change notification settings - Fork 11
/
rollup.config.js
48 lines (46 loc) · 1 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
import commonjs from '@rollup/plugin-commonjs';
import postcss from 'rollup-plugin-postcss';
import { terser } from 'rollup-plugin-terser';
import typescript from 'rollup-plugin-typescript2';
import pkg from './package.json';
const globals = {
react: 'React',
'react-dom': 'ReactDOM',
'@material-ui/core': 'MaterialUI',
'@material-ui/lab': 'MaterialUILab',
'@visx/visx': 'Visx',
};
export default {
input: './src/index.ts',
external: [
...Object.keys(pkg.dependencies),
...Object.keys(pkg.devDependencies),
],
output: [
{
file: `./dist/${pkg.main}`,
format: 'cjs',
globals,
sourcemap: true,
},
{
file: `./dist/${pkg.module}`,
format: 'es',
globals,
sourcemap: true,
},
],
plugins: [
commonjs(),
postcss({
plugins: [
require('postcss-easy-import')({ prefix: '_' }), // keep this first
require('cssnano')({
preset: 'default',
}),
],
}),
typescript(),
terser(),
],
};