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