forked from cubiq/add-to-homescreen
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrollup.config.js
35 lines (30 loc) · 886 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
import babel from 'rollup-plugin-babel';
import replace from 'rollup-plugin-replace';
import { uglify } from 'rollup-plugin-uglify';
import pkg from './package.json';
const input = './src/index.js';
function external(id) {
return !id.startsWith('.') && !id.startsWith('/');
}
const config = [
{
input,
output: { file: `build/${pkg.name}.js`, format: 'cjs' },
external,
plugins: [
babel({ exclude: /node_modules/ }),
replace({ 'process.env.NODE_ENV': JSON.stringify('development') })
]
},
{
input,
output: { file: `build/${pkg.name}.min.js`, format: 'cjs' },
external,
plugins: [
babel({ exclude: /node_modules/ }),
replace({ 'process.env.NODE_ENV': JSON.stringify('production') }),
uglify()
]
}
];
export default config;