Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Random Rollup tweaks #6034

Merged
merged 7 commits into from
May 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 8 additions & 6 deletions build-scripts/gulp/rollup.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -90,26 +92,26 @@ 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,
});
});

gulp.task("rollup-dev-server-gallery", () => {
watchRollup(rollupConfig.createGalleryConfig, ["gallery/src"], {
watchRollup(rollupConfig.createGalleryConfig, ["gallery/src/**"], {
root: paths.gallery_output_root,
port: 8100,
});
Expand Down
1 change: 1 addition & 0 deletions build-scripts/rollup-plugins/worker-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 6 additions & 3 deletions build-scripts/rollup.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
Expand Down
4 changes: 2 additions & 2 deletions demo/public/manifest.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand Down Expand Up @@ -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"
}