mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-23 09:16:38 +00:00
Cleanup of builds (#6106)
This commit is contained in:
parent
a376f4525b
commit
f819e2cf8d
@ -85,8 +85,8 @@ module.exports.babelExclude = () => [
|
|||||||
const outputPath = (outputRoot, latestBuild) =>
|
const outputPath = (outputRoot, latestBuild) =>
|
||||||
path.resolve(outputRoot, latestBuild ? "frontend_latest" : "frontend_es5");
|
path.resolve(outputRoot, latestBuild ? "frontend_latest" : "frontend_es5");
|
||||||
|
|
||||||
const publicPath = (latestBuild) =>
|
const publicPath = (latestBuild, root = "") =>
|
||||||
latestBuild ? "/frontend_latest/" : "/frontend_es5/";
|
latestBuild ? `${root}/frontend_latest/` : `${root}/frontend_es5/`;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
BundleConfig {
|
BundleConfig {
|
||||||
|
@ -6,30 +6,32 @@ const merge = require("merge-stream");
|
|||||||
const path = require("path");
|
const path = require("path");
|
||||||
const paths = require("../paths");
|
const paths = require("../paths");
|
||||||
|
|
||||||
|
const zopfliOptions = { threshold: 150 };
|
||||||
|
|
||||||
gulp.task("compress-app", function compressApp() {
|
gulp.task("compress-app", function compressApp() {
|
||||||
const jsLatest = gulp
|
const jsLatest = gulp
|
||||||
.src(path.resolve(paths.app_output_latest, "**/*.js"))
|
.src(path.resolve(paths.app_output_latest, "**/*.js"))
|
||||||
.pipe(zopfli({ threshold: 150 }))
|
.pipe(zopfli(zopfliOptions))
|
||||||
.pipe(gulp.dest(paths.app_output_latest));
|
.pipe(gulp.dest(paths.app_output_latest));
|
||||||
|
|
||||||
const jsEs5 = gulp
|
const jsEs5 = gulp
|
||||||
.src(path.resolve(paths.app_output_es5, "**/*.js"))
|
.src(path.resolve(paths.app_output_es5, "**/*.js"))
|
||||||
.pipe(zopfli({ threshold: 150 }))
|
.pipe(zopfli(zopfliOptions))
|
||||||
.pipe(gulp.dest(paths.app_output_es5));
|
.pipe(gulp.dest(paths.app_output_es5));
|
||||||
|
|
||||||
const polyfills = gulp
|
const polyfills = gulp
|
||||||
.src(path.resolve(paths.app_output_static, "polyfills/*.js"))
|
.src(path.resolve(paths.app_output_static, "polyfills/*.js"))
|
||||||
.pipe(zopfli({ threshold: 150 }))
|
.pipe(zopfli(zopfliOptions))
|
||||||
.pipe(gulp.dest(path.resolve(paths.app_output_static, "polyfills")));
|
.pipe(gulp.dest(path.resolve(paths.app_output_static, "polyfills")));
|
||||||
|
|
||||||
const translations = gulp
|
const translations = gulp
|
||||||
.src(path.resolve(paths.app_output_static, "translations/**/*.json"))
|
.src(path.resolve(paths.app_output_static, "translations/**/*.json"))
|
||||||
.pipe(zopfli({ threshold: 150 }))
|
.pipe(zopfli(zopfliOptions))
|
||||||
.pipe(gulp.dest(path.resolve(paths.app_output_static, "translations")));
|
.pipe(gulp.dest(path.resolve(paths.app_output_static, "translations")));
|
||||||
|
|
||||||
const icons = gulp
|
const icons = gulp
|
||||||
.src(path.resolve(paths.app_output_static, "mdi/*.json"))
|
.src(path.resolve(paths.app_output_static, "mdi/*.json"))
|
||||||
.pipe(zopfli({ threshold: 150 }))
|
.pipe(zopfli(zopfliOptions))
|
||||||
.pipe(gulp.dest(path.resolve(paths.app_output_static, "mdi")));
|
.pipe(gulp.dest(path.resolve(paths.app_output_static, "mdi")));
|
||||||
|
|
||||||
return merge(jsLatest, jsEs5, polyfills, translations, icons);
|
return merge(jsLatest, jsEs5, polyfills, translations, icons);
|
||||||
@ -38,6 +40,6 @@ gulp.task("compress-app", function compressApp() {
|
|||||||
gulp.task("compress-hassio", function compressApp() {
|
gulp.task("compress-hassio", function compressApp() {
|
||||||
return gulp
|
return gulp
|
||||||
.src(path.resolve(paths.hassio_output_root, "**/*.js"))
|
.src(path.resolve(paths.hassio_output_root, "**/*.js"))
|
||||||
.pipe(zopfli())
|
.pipe(zopfli(zopfliOptions))
|
||||||
.pipe(gulp.dest(paths.hassio_output_root));
|
.pipe(gulp.dest(paths.hassio_output_root));
|
||||||
});
|
});
|
||||||
|
@ -1,11 +1,8 @@
|
|||||||
const { createCastConfig } = require("../build-scripts/webpack.js");
|
const { createCastConfig } = require("../build-scripts/webpack.js");
|
||||||
const { isProdBuild } = require("../build-scripts/env.js");
|
const { isProdBuild, isStatsBuild } = require("../build-scripts/env.js");
|
||||||
|
|
||||||
// File just used for stats builds
|
|
||||||
|
|
||||||
const latestBuild = true;
|
|
||||||
|
|
||||||
module.exports = createCastConfig({
|
module.exports = createCastConfig({
|
||||||
isProdBuild: isProdBuild(),
|
isProdBuild: isProdBuild(),
|
||||||
latestBuild,
|
isStatsBuild: isStatsBuild(),
|
||||||
|
latestBuild: true,
|
||||||
});
|
});
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
const { createGalleryConfig } = require("../build-scripts/webpack.js");
|
const { createGalleryConfig } = require("../build-scripts/webpack.js");
|
||||||
|
const { isProdBuild, isStatsBuild } = require("../build-scripts/env.js");
|
||||||
|
|
||||||
module.exports = createGalleryConfig({
|
module.exports = createGalleryConfig({
|
||||||
|
isProdBuild: isProdBuild(),
|
||||||
|
isStatsBuild: isStatsBuild(),
|
||||||
latestBuild: true,
|
latestBuild: true,
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user