mirror of
https://github.com/home-assistant/frontend.git
synced 2025-12-20 02:38:53 +00:00
* Install gulp as dev dependency
* Placeholder gulpfile
* Replace rollup invocations with gulp
* Consolidate duplicated code
* Big cleanup of gulpfile
* Without cache test
* Revert "Without cache test"
This reverts commit 0e3881d8d7.
58 lines
1010 B
JavaScript
58 lines
1010 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,
|
|
};
|