From 1de429f27555494f9ee9b485aaf18389206a23ab Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Wed, 20 Dec 2017 12:36:35 +0530 Subject: [PATCH] Faster bench build in development --- frappe/build.js | 2 +- frappe/commands/utils.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/frappe/build.js b/frappe/build.js index 6495e2a359..103b66fdaa 100644 --- a/frappe/build.js +++ b/frappe/build.js @@ -144,7 +144,7 @@ function get_compiled_file(file, output_path, minify, force_compile) { file_content = minify_js(file_content, file); } - if (file.endsWith('.js') && !file.includes('/lib/') && output_type === 'js' && !file.endsWith('class.js')) { + if (minify && file.endsWith('.js') && !file.includes('/lib/') && output_type === 'js' && !file.endsWith('class.js')) { file_content = babelify(file_content, file, minify); } diff --git a/frappe/commands/utils.py b/frappe/commands/utils.py index 0f68e7ddd6..ff606d940d 100644 --- a/frappe/commands/utils.py +++ b/frappe/commands/utils.py @@ -15,7 +15,9 @@ def build(make_copy=False, restore = False, verbose=False): import frappe.build import frappe frappe.init('') - frappe.build.bundle(False, make_copy=make_copy, restore = restore, verbose=verbose) + # don't minify in developer_mode for faster builds + no_compress = frappe.local.conf.developer_mode or False + frappe.build.bundle(no_compress, make_copy=make_copy, restore = restore, verbose=verbose) @click.command('watch') def watch():