mirror of
https://github.com/home-assistant/frontend.git
synced 2025-06-15 06:36:35 +00:00

* 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
58 lines
1001 B
JavaScript
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,
|
|
};
|