From b8e71609db2494a107fdbe76436cd3dfe63aed4d Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Mon, 25 May 2020 01:12:42 -0700 Subject: [PATCH] Random Rollup tweaks (#6034) --- build-scripts/gulp/rollup.js | 14 ++++++++------ build-scripts/rollup-plugins/worker-plugin.js | 1 + build-scripts/rollup.js | 9 ++++++--- demo/public/manifest.json | 4 ++-- 4 files changed, 17 insertions(+), 11 deletions(-) diff --git a/build-scripts/gulp/rollup.js b/build-scripts/gulp/rollup.js index 5cccc7d58f..07b6781d01 100644 --- a/build-scripts/gulp/rollup.js +++ b/build-scripts/gulp/rollup.js @@ -56,14 +56,16 @@ function watchRollup(createConfig, extraWatchSrc = [], serveOptions) { ...inputOptions, output: [outputOptions], watch: { - include: ["src"] + extraWatchSrc, + include: ["src/**"] + extraWatchSrc, }, }); let startedHttp = false; watcher.on("event", (event) => { - if (event.code === "ERROR") { + if (event.code === "BUNDLE_END") { + log(`Build done @ ${new Date().toLocaleTimeString()}`); + } else if (event.code === "ERROR") { log.error(event.error); } else if (event.code === "END") { if (startedHttp || !serveOptions) { @@ -90,18 +92,18 @@ gulp.task("rollup-watch-app", () => { }); gulp.task("rollup-watch-hassio", () => { - watchRollup(rollupConfig.createHassioConfig, ["hassio/src"]); + watchRollup(rollupConfig.createHassioConfig, ["hassio/src/**"]); }); gulp.task("rollup-dev-server-demo", () => { - watchRollup(rollupConfig.createDemoConfig, ["demo/src"], { + watchRollup(rollupConfig.createDemoConfig, ["demo/src/**"], { root: paths.demo_output_root, port: 8090, }); }); gulp.task("rollup-dev-server-cast", () => { - watchRollup(rollupConfig.createCastConfig, ["cast/src"], { + watchRollup(rollupConfig.createCastConfig, ["cast/src/**"], { root: paths.cast_output_root, port: 8080, networkAccess: true, @@ -109,7 +111,7 @@ gulp.task("rollup-dev-server-cast", () => { }); gulp.task("rollup-dev-server-gallery", () => { - watchRollup(rollupConfig.createGalleryConfig, ["gallery/src"], { + watchRollup(rollupConfig.createGalleryConfig, ["gallery/src/**"], { root: paths.gallery_output_root, port: 8100, }); diff --git a/build-scripts/rollup-plugins/worker-plugin.js b/build-scripts/rollup-plugins/worker-plugin.js index 96dc7c8acd..0aa05273ca 100644 --- a/build-scripts/rollup-plugins/worker-plugin.js +++ b/build-scripts/rollup-plugins/worker-plugin.js @@ -115,6 +115,7 @@ module.exports = function (opts = {}) { if (resolvedWorkerFile in refIds) { chunkRefId = refIds[resolvedWorkerFile]; } else { + this.addWatchFile(resolvedWorkerFile); const source = await getBundledWorker( resolvedWorkerFile, rollupOptions diff --git a/build-scripts/rollup.js b/build-scripts/rollup.js index 52cacdb6b3..3757f25866 100644 --- a/build-scripts/rollup.js +++ b/build-scripts/rollup.js @@ -96,9 +96,12 @@ const createRollupConfig = ({ // https://rollupjs.org/guide/en/#outputentryfilenames // https://rollupjs.org/guide/en/#outputchunkfilenames // https://rollupjs.org/guide/en/#outputassetfilenames - entryFileNames: isProdBuild ? "[name]-[hash].js" : "[name].js", - chunkFileNames: isProdBuild ? "c.[hash].js" : "[name].js", - assetFileNames: isProdBuild ? "a.[hash].js" : "[name].js", + entryFileNames: + isProdBuild && !isStatsBuild ? "[name]-[hash].js" : "[name].js", + chunkFileNames: + isProdBuild && !isStatsBuild ? "c.[hash].js" : "[name].js", + assetFileNames: + isProdBuild && !isStatsBuild ? "a.[hash].js" : "[name].js", // https://rollupjs.org/guide/en/#outputsourcemap sourcemap: isProdBuild ? true : "inline", }, diff --git a/demo/public/manifest.json b/demo/public/manifest.json index f364cab750..901a8780a1 100644 --- a/demo/public/manifest.json +++ b/demo/public/manifest.json @@ -1,6 +1,6 @@ { "background_color": "#FFFFFF", - "description": "Open-source home automation platform running on Python 3.", + "description": "Home automation platform that puts local control and privacy first.", "dir": "ltr", "display": "standalone", "icons": [ @@ -31,7 +31,7 @@ ], "lang": "en-US", "name": "Home Assistant Demo", - "short_name": "Demo", + "short_name": "HA Demo", "start_url": "/?homescreen=1", "theme_color": "#03A9F4" }