mirror of
https://github.com/home-assistant/frontend.git
synced 2025-12-27 06:06:30 +00:00
Minify once, reduce build warnings (#692)
* Minify once, reduce build warnings * Remove rollup-plugin-uglify * address comment
This commit is contained in:
@@ -1,58 +0,0 @@
|
||||
const commonjs = require('rollup-plugin-commonjs');
|
||||
const nodeResolve = require('rollup-plugin-node-resolve');
|
||||
const replace = require('rollup-plugin-replace');
|
||||
const babel = require('rollup-plugin-babel');
|
||||
const uglify = require('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),
|
||||
__BUILD__: JSON.stringify('es5'),
|
||||
},
|
||||
}),
|
||||
];
|
||||
|
||||
if (!DEV) {
|
||||
plugins.push(uglify());
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
format: 'iife',
|
||||
exports: 'none',
|
||||
treeshake: true,
|
||||
plugins,
|
||||
};
|
||||
Reference in New Issue
Block a user