Skip to content

Commit

Permalink
Fix build by not using brotli compression yet (#783)
Browse files Browse the repository at this point in the history
* Include dummy sw files to fix build

* No br support yet
  • Loading branch information
ludeeus authored Sep 3, 2024
1 parent b248e46 commit d044ad9
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 9 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/TestBuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,3 @@ jobs:
run: script/bootstrap
- name: Build
run: script/build
env:
IS_TEST: "true"
2 changes: 1 addition & 1 deletion script/build
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ if [ ! -d "./node_modules" ]; then
yarn install
fi

./node_modules/.bin/gulp build-hacs
NODE_OPTIONS=--max_old_space_size=6144 ./node_modules/.bin/gulp build-hacs
12 changes: 6 additions & 6 deletions script/gulp/app.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import gulp from "gulp";
import env from "./env.cjs";
import "./clean.js";
import "../../homeassistant-frontend/build-scripts/gulp/compress.js";
import "./compress.js";
import "./entry-html.js";
import "./gather-static.js";
import "../../homeassistant-frontend/build-scripts/gulp/gen-icons-json.js";
Expand All @@ -20,12 +20,12 @@ gulp.task(
"gen-dummy-icons-json",
"gen-pages-app-dev",
"build-locale-data",
"generate-translations"
"generate-translations",
),
"build-translation-fingerprints",
"copy-static-app",
"webpack-watch-app"
)
"webpack-watch-app",
),
);

gulp.task(
Expand All @@ -41,6 +41,6 @@ gulp.task(
"webpack-prod-app",
// Don't compress running tests
...(env.isTestBuild() ? [] : ["compress-app"]),
"gen-pages-app-prod"
)
"gen-pages-app-prod",
),
);
16 changes: 16 additions & 0 deletions script/gulp/compress.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Tasks to compress
// Can not reuse HA compress.js untill min version is 2024.8

import gulp from "gulp";
import zopfli from "gulp-zopfli-green";
import paths from "./paths.cjs";

const zopfliOptions = { threshold: 150 };

const compressDist = (rootDir) =>
gulp
.src([`${rootDir}/**/*.{js,json,css,svg,xml}`, `${rootDir}/{authorize,onboarding}.html`])
.pipe(zopfli(zopfliOptions))
.pipe(gulp.dest(rootDir));

gulp.task("compress-app", () => compressDist(paths.app_output_root));

0 comments on commit d044ad9

Please sign in to comment.