diff --git a/hassio/index.html b/hassio/index.html index abf2d78649..eeb979cb52 100644 --- a/hassio/index.html +++ b/hassio/index.html @@ -19,7 +19,7 @@ function addScript(src) { var e = document.createElement('script'); e.src = src; - document.head.appendChild(e); + document.write(e.outerHTML); } var webComponentsSupported = ( 'customElements' in window && @@ -29,6 +29,10 @@ addScript('/static/webcomponents-bundle.js'); } - + + diff --git a/hassio/script/build_hassio b/hassio/script/build_hassio index 8388b902ef..2249484ed0 100755 --- a/hassio/script/build_hassio +++ b/hassio/script/build_hassio @@ -12,3 +12,11 @@ rm -rf $OUTPUT_DIR_ES5 node script/gen-icons.js NODE_ENV=production ../node_modules/.bin/webpack -p node script/gen-index-html.js + +# Temporarily re-create old HTML import +echo "" >> $OUTPUT_DIR_ES5/hassio-app.html +rm $OUTPUT_DIR_ES5/app.js* +rm $OUTPUT_DIR_ES5/chunk.* diff --git a/hassio/webpack.config.js b/hassio/webpack.config.js index 5a43329dbe..92130d0401 100644 --- a/hassio/webpack.config.js +++ b/hassio/webpack.config.js @@ -11,7 +11,7 @@ if (!version) { const VERSION = version[0]; const isProdBuild = process.env.NODE_ENV === 'production' const chunkFilename = isProdBuild ? - '[name]-[chunkhash].chunk.js' : '[name].chunk.js'; + 'chunk.[chunkhash].js' : '[name].chunk.js'; const plugins = [ new webpack.DefinePlugin({ @@ -33,7 +33,9 @@ if (isProdBuild) { module.exports = { mode: isProdBuild ? 'production' : 'development', - devtool: isProdBuild ? 'source-map ' : 'inline-source-map', + // Disabled in prod while we make Home Assistant able to serve the right files. + // Was source-map + devtool: isProdBuild ? 'none' : 'inline-source-map', entry: { app: './src/hassio-app.js', },