diff --git a/esbuild/esbuild.js b/esbuild/esbuild.js index b0ed92f9ec..c71fbc752c 100644 --- a/esbuild/esbuild.js +++ b/esbuild/esbuild.js @@ -44,7 +44,7 @@ let argv = yargs type: "boolean", description: "Run in watch mode and rebuild on file changes" }) - .option("auto-reload", { + .option("live-reload", { type: "boolean", description: `Automatically reload webpages when assets are rebuilt. Can only be used with the --watch flag.` @@ -481,7 +481,7 @@ async function notify_redis({ error, success }) { if (success) { payload = { success: true, - autoreload: argv["auto-reload"] + live_reload: argv["live-reload"] }; } diff --git a/frappe/build.py b/frappe/build.py index ec092d4b57..4472049ab7 100644 --- a/frappe/build.py +++ b/frappe/build.py @@ -235,8 +235,12 @@ def watch(apps=None): if apps: command += " --apps {apps}".format(apps=apps) - if frappe.conf.autoreload_on_build: - command += " --auto-reload" + live_reload = frappe.conf.live_reload + if "LIVE_RELOAD" in os.environ: + live_reload = os.environ["LIVE_RELOAD"] + + if live_reload: + command += " --live-reload" check_node_executable() frappe_app_path = frappe.get_app_path("frappe", "..") diff --git a/frappe/public/js/frappe/build_events/BuildSuccess.vue b/frappe/public/js/frappe/build_events/BuildSuccess.vue index d489c4a1a3..5ab40271bb 100644 --- a/frappe/public/js/frappe/build_events/BuildSuccess.vue +++ b/frappe/public/js/frappe/build_events/BuildSuccess.vue @@ -5,7 +5,7 @@ > Compiled successfully Refresh @@ -18,13 +18,13 @@ export default { data() { return { is_shown: false, - autoreload: false, + live_reload: false, }; }, methods: { show(data) { - if (data.autoreload) { - this.autoreload = true; + if (data.live_reload) { + this.live_reload = true; this.reload(); }