core/script/build_frontend

35 lines
1.1 KiB
Plaintext
Raw Normal View History

#!/bin/sh
2015-02-23 01:33:01 +00:00
# Builds the frontend for production
2015-02-09 07:33:19 +00:00
# Stop on errors
set -e
cd "$(dirname "$0")/.."
2015-01-17 22:32:33 +00:00
# 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.js* \
homeassistant/components/frontend/www_static/custom-elements-es5-adapter.js* \
homeassistant/components/frontend/www_static/panels
cd homeassistant/components/frontend/www_static/home-assistant-polymer
2015-02-06 06:36:23 +00:00
# Build frontend
BUILD_DEV=0 ./node_modules/.bin/gulp
cp bower_components/webcomponentsjs/webcomponents-lite.js ..
cp bower_components/webcomponentsjs/custom-elements-es5-adapter.js ..
2017-08-02 08:46:08 +00:00
cp build/*.js build/*.html ..
mkdir ../panels
cp build/panels/*.html ../panels
BUILD_DEV=0 ./node_modules/.bin/gulp gen-service-worker
2016-05-28 04:45:38 +00:00
cp build/service_worker.js ..
cd ..
# Pack frontend
gzip -f -n -k -9 *.html *.js ./panels/*.html
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
script/fingerprint_frontend.py