-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
45 lines (37 loc) · 868 Bytes
/
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
import linaria from '@linaria/rollup';
import postcss from 'rollup-plugin-postcss';
import babel from '@rollup/plugin-babel';
export default {
input: 'src/index.js',
output: [
// Works w/ PostCSS, not with Linaria
{
dir: 'dist/preserveModules',
format: 'esm',
preserveModules: true,
sourcemap: true,
},
// Works w/ PostCSS & Linaria, but doesn't support tree-shaking
{
dir: 'dist/noPreserveModules',
format: 'esm',
sourcemap: true,
},
// Works w/ PostCSS & Linaria, but doesn't support tree-shaking
{
file: 'dist/cjs.bundle.js',
format: 'cjs',
sourcemap: true,
},
],
external: ['react'],
plugins: [
linaria({
sourceMap: process.env.NODE_ENV !== 'production',
}),
postcss({
exclude: 'node_modules/**',
}),
babel(),
],
};