mirror of
https://github.com/home-assistant/frontend.git
synced 2025-04-27 14:57:20 +00:00
39 lines
1.1 KiB
JavaScript
39 lines
1.1 KiB
JavaScript
// Tasks to compress
|
|
|
|
const gulp = require("gulp");
|
|
const zopfli = require("gulp-zopfli-green");
|
|
const merge = require("merge-stream");
|
|
const path = require("path");
|
|
const paths = require("../paths");
|
|
|
|
gulp.task("compress-app", function compressApp() {
|
|
const jsLatest = gulp
|
|
.src(path.resolve(paths.output, "**/*.js"))
|
|
.pipe(zopfli())
|
|
.pipe(gulp.dest(paths.output));
|
|
|
|
const jsEs5 = gulp
|
|
.src(path.resolve(paths.output_es5, "**/*.js"))
|
|
.pipe(zopfli())
|
|
.pipe(gulp.dest(paths.output_es5));
|
|
|
|
const polyfills = gulp
|
|
.src(path.resolve(paths.static, "polyfills/*.js"))
|
|
.pipe(zopfli())
|
|
.pipe(gulp.dest(path.resolve(paths.static, "polyfills")));
|
|
|
|
const translations = gulp
|
|
.src(path.resolve(paths.static, "translations/*.json"))
|
|
.pipe(zopfli())
|
|
.pipe(gulp.dest(path.resolve(paths.static, "translations")));
|
|
|
|
return merge(jsLatest, jsEs5, polyfills, translations);
|
|
});
|
|
|
|
gulp.task("compress-hassio", function compressApp() {
|
|
return gulp
|
|
.src(path.resolve(paths.hassio_root, "**/*.js"))
|
|
.pipe(zopfli())
|
|
.pipe(gulp.dest(paths.hassio_root));
|
|
});
|