forked from home-assistant/core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_frontend
executable file
·31 lines (25 loc) · 895 Bytes
/
build_frontend
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/sh
# Builds the frontend for production
# Stop on errors
set -e
cd "$(dirname "$0")/.."
# Clean up
rm -rf homeassistant/components/frontend/www_static/core.js* \
homeassistant/components/frontend/www_static/compatibility.js* \
homeassistant/components/frontend/www_static/frontend.html* \
homeassistant/components/frontend/www_static/webcomponents-lite.min.js* \
homeassistant/components/frontend/www_static/panels
cd homeassistant/components/frontend/www_static/home-assistant-polymer
npm run clean
# Build frontend
npm run frontend_prod
cp bower_components/webcomponentsjs/webcomponents-lite.min.js ..
cp -r build/* ..
BUILD_DEV=0 node script/gen-service-worker.js
cp build/service_worker.js ..
cd ..
# Pack frontend
gzip -f -n -k -9 *.html *.js ./panels/*.html
cd ../../../..
# Generate the MD5 hash of the new frontend
script/fingerprint_frontend.py