2017-01-02 22:04:09 +01:00
|
|
|
#!/bin/sh
|
2015-02-22 17:33:01 -08:00
|
|
|
# Builds the frontend for production
|
2015-02-08 23:33:19 -08:00
|
|
|
|
2017-01-02 22:04:09 +01:00
|
|
|
# Stop on errors
|
|
|
|
set -e
|
|
|
|
|
2015-09-17 00:35:26 -07:00
|
|
|
cd "$(dirname "$0")/.."
|
2015-01-17 14:32:33 -08:00
|
|
|
|
2017-01-02 22:04:09 +01:00
|
|
|
# Clean up
|
|
|
|
rm -rf homeassistant/components/frontend/www_static/core.js* \
|
2017-02-14 15:00:45 -05:00
|
|
|
homeassistant/components/frontend/www_static/compatibility.js* \
|
2017-01-02 22:04:09 +01:00
|
|
|
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
|
2016-07-16 22:32:25 -07:00
|
|
|
npm run clean
|
2015-02-05 22:36:23 -08:00
|
|
|
|
2017-01-02 22:04:09 +01:00
|
|
|
# Build frontend
|
|
|
|
npm run frontend_prod
|
2015-07-12 20:43:07 -07:00
|
|
|
cp bower_components/webcomponentsjs/webcomponents-lite.min.js ..
|
2016-07-16 22:32:25 -07:00
|
|
|
cp -r build/* ..
|
2016-08-14 01:10:07 -07:00
|
|
|
BUILD_DEV=0 node script/gen-service-worker.js
|
2016-05-27 21:45:38 -07:00
|
|
|
cp build/service_worker.js ..
|
2016-07-16 22:32:25 -07:00
|
|
|
cd ..
|
|
|
|
|
2017-01-02 22:04:09 +01:00
|
|
|
# Pack frontend
|
2016-07-16 22:32:25 -07:00
|
|
|
gzip -f -k -9 *.html *.js ./panels/*.html
|
2017-01-02 22:04:09 +01:00
|
|
|
cd ../../../..
|
2016-05-27 21:45:38 -07:00
|
|
|
|
2014-11-12 00:36:20 -08:00
|
|
|
# Generate the MD5 hash of the new frontend
|
2016-07-16 22:32:25 -07:00
|
|
|
script/fingerprint_frontend.py
|