More cleanup (#1185)

* More cleanup

* Set up correct urls authorize.html

* Fix polymer lint

* Remove reference to bower

* Tweak uglify settings
This commit is contained in:
Paulus Schoutsen
2018-05-17 17:51:07 -04:00
committed by GitHub
parent cb0db95abe
commit bc27f854f1
25 changed files with 151 additions and 247 deletions
+7 -9
View File
@@ -15,24 +15,22 @@ mkdir $OUTPUT_DIR_ES5
cp -r public/__init__.py $OUTPUT_DIR_ES5/
# Build frontend
BUILD_DEV=0 ./node_modules/.bin/gulp build-translations authorize authorize-es5
NODE_ENV=production ./node_modules/.bin/webpack -p
BUILD_DEV=0 ./node_modules/.bin/gulp build-translations
NODE_ENV=production ./node_modules/.bin/webpack
# Icons
script/update_mdi.py
./node_modules/.bin/gulp compress
# Stub the service worker
touch $OUTPUT_DIR/service_worker.js
touch $OUTPUT_DIR_ES5/service_worker.js
# Generate the __init__ file
echo "VERSION = '`git rev-parse HEAD`'" >> $OUTPUT_DIR/__init__.py
echo "CREATED_AT = `date +%s`" >> $OUTPUT_DIR/__init__.py
echo "VERSION = '`git rev-parse HEAD`'" >> $OUTPUT_DIR_ES5/__init__.py
echo "CREATED_AT = `date +%s`" >> $OUTPUT_DIR_ES5/__init__.py
# Generate the MD5 hash of the new frontend
./node_modules/.bin/gulp gen-index-html
./node_modules/.bin/gulp gen-index-html-es5
# Generate index.htmls with the MD5 hash of the builds
./node_modules/.bin/gulp \
gen-index-html gen-index-html-es5 \
gen-authorize-html gen-authorize-html-es5
+11 -5
View File
@@ -5,16 +5,22 @@
set -e
OUTPUT_DIR=hass_frontend
OUTPUT_DIR_ES5=hass_frontend_es5
rm -rf $OUTPUT_DIR
rm -rf $OUTPUT_DIR $OUTPUT_DIR_ES5
cp -r public $OUTPUT_DIR
mkdir $OUTPUT_DIR_ES5
# Needed in case frontend repo installed with pip3 install -e
cp -r public/__init__.py $OUTPUT_DIR_ES5/
./node_modules/.bin/gulp build-translations authorize authorize-es5
./node_modules/.bin/gulp build-translations
cp src/authorize.html $OUTPUT_DIR
# Manually copy over this file as we don't run the ES5 build
# The Hass.io panel depends on it.
cp node_modules/@webcomponents/webcomponentsjs/custom-elements-es5-adapter.js $OUTPUT_DIR_ES5
# Icons
script/update_mdi.py
# Stub the service worker
touch $OUTPUT_DIR/service_worker.js
./node_modules/.bin/webpack --watch --progress