-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathrollup.config.js
40 lines (38 loc) · 885 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
import { nodeResolve } from '@rollup/plugin-node-resolve';
import { terser } from 'rollup-plugin-terser';
import postcss from 'rollup-plugin-postcss';
const IS_PRODUCTION = process.env.NODE_ENV === 'production';
export default [
{
input: 'src/index.js',
output: {
format: 'es',
file: IS_PRODUCTION
? 'dist/web-vitals-element.min.js'
: 'dist/web-vitals-element.js',
},
plugins: [
nodeResolve(),
IS_PRODUCTION ? terser() : null,
postcss({
plugins: [],
}),
],
},
{
input: 'src/index-styled.js',
output: {
format: 'es',
file: IS_PRODUCTION
? 'dist/web-vitals-element.styled.min.js'
: 'dist/web-vitals-element.styled.js',
},
plugins: [
nodeResolve(),
IS_PRODUCTION ? terser() : null,
postcss({
plugins: [],
}),
],
},
];