forked from home-assistant/frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
57 lines (50 loc) · 1010 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
46
47
48
49
50
51
52
53
54
55
56
57
import commonjs from 'rollup-plugin-commonjs';
import nodeResolve from 'rollup-plugin-node-resolve';
import replace from 'rollup-plugin-replace';
import babel from 'rollup-plugin-babel';
import uglify from 'rollup-plugin-uglify';
const DEV = !!JSON.parse(process.env.BUILD_DEV || 'true');
const DEMO = !!JSON.parse(process.env.BUILD_DEMO || 'false');
const plugins = [
babel({
"babelrc": false,
"presets": [
[
"es2015",
{
"modules": false
}
]
],
"plugins": [
"external-helpers",
"transform-object-rest-spread",
[
"transform-react-jsx",
{
"pragma":"h"
}
],
]
}),
nodeResolve({
jsnext: true,
main: true,
}),
commonjs(),
replace({
values: {
__DEV__: JSON.stringify(DEV),
__DEMO__: JSON.stringify(DEMO),
},
}),
];
if (!DEV) {
plugins.push(uglify());
}
export default {
format: 'iife',
exports: 'none',
treeshake: true,
plugins,
};