From 8c464ab3f68b5947e21ad3ea4fb27cb17c3629c3 Mon Sep 17 00:00:00 2001 From: Pedro Costa Date: Mon, 22 Feb 2021 17:43:04 -0300 Subject: [PATCH] CPD-6052 | Minifying template by default. --- lib/moonshot/dynamic_template.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/moonshot/dynamic_template.rb b/lib/moonshot/dynamic_template.rb index 727bd818..48e3d51e 100644 --- a/lib/moonshot/dynamic_template.rb +++ b/lib/moonshot/dynamic_template.rb @@ -63,11 +63,15 @@ def validate_template(template) end def generate_template - ERB.new(@source).result(parameters_obj.expose_binding) + ERB.new(minify_template_source).result(parameters_obj.expose_binding) end def write_output(content) File.write(@destination, content) end + + def minify_template_source + JSON.parse(@source).to_json + end end end