frontend/rollup.config.js
Paulus Schoutsen 512b07963b Add build using polymer-build (#344)
* Add build using polymer-build

* Use bundle strategies to tweak stripExcludes

* Only vulcanize hass.io panel

* Rename hassio panel generate script

* Remove hydrolysis

* Get it all somewhat working

* Fixes

* Allow ES2015 + fix minify JS

* Clarify we need to fix service worker minify

* Move service worker template out of tasks folder

* Fix broken CSS

* Wrap it up

* Fix maps
2017-08-02 21:31:04 -07:00

58 lines
1001 B
JavaScript

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,
};