Skip to content

Commit

Permalink
CPD-6052 | Minifying template by default.
Browse files Browse the repository at this point in the history
  • Loading branch information
pcostaacquia committed Feb 23, 2021
1 parent 15c5efe commit 8c464ab
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/moonshot/dynamic_template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 8c464ab

Please sign in to comment.