Gulpify build pipeline (#3145)

* Gulpify build pipeline

* Update build frontend script

* Fixes

* Limit service worker to latest build

* Use shorthand

* Fix hassio build
This commit is contained in:
Paulus Schoutsen
2019-05-02 11:35:46 -07:00
committed by GitHub
parent 8b98f375c2
commit 6c41c7b1ab
79 changed files with 850 additions and 460 deletions

View File

@@ -6,19 +6,4 @@ set -e
cd "$(dirname "$0")/.."
BUILD_DIR=build
BUILD_TRANSLATIONS_DIR=build-translations
OUTPUT_DIR=hass_frontend
OUTPUT_DIR_ES5=hass_frontend_es5
rm -rf $OUTPUT_DIR $OUTPUT_DIR_ES5 $BUILD_DIR $BUILD_TRANSLATIONS_DIR
# Build frontend
./node_modules/.bin/gulp build-translations gen-icons
NODE_ENV=production ./node_modules/.bin/webpack
# 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
./node_modules/.bin/gulp build-release

View File

@@ -6,14 +6,4 @@ set -e
cd "$(dirname "$0")/.."
BUILD_DIR=build
OUTPUT_DIR=hass_frontend
OUTPUT_DIR_ES5=hass_frontend_es5
rm -rf $OUTPUT_DIR $OUTPUT_DIR_ES5 $BUILD_DIR
mkdir $OUTPUT_DIR $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 gen-icons
./node_modules/.bin/webpack --watch --progress
./node_modules/.bin/gulp develop

View File

@@ -7,5 +7,5 @@ set -e
cd "$(dirname "$0")/.."
STATS=1 NODE_ENV=production webpack --profile --json > compilation-stats.json
npx webpack-bundle-analyzer compilation-stats.json hass_frontend
npx webpack-bundle-analyzer compilation-stats.json hass_frontend/frontend_latest
rm compilation-stats.json