From 98ea70bfa08fd6ee529536a1f3b5eaceb483e7ec Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Tue, 20 Jul 2021 19:00:28 +0100 Subject: [PATCH] Use harmony option with Uglifier when minimizing javascript Resolves a bug where the asset pipeline tries to minify assets that have already been minified by Webpack --- config/environments/production.rb | 2 +- config/environments/staging.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/environments/production.rb b/config/environments/production.rb index 9d110a9ca8..c6bc4902f3 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -55,7 +55,7 @@ Openfoodnetwork::Application.configure do # config.assets.precompile += %w( search.js ) require 'uglifier' - config.assets.js_compressor = Uglifier.new(mangle: false) + config.assets.js_compressor = Uglifier.new(mangle: false, harmony: true) # Disable delivery errors, bad email addresses will be ignored # config.action_mailer.raise_delivery_errors = false diff --git a/config/environments/staging.rb b/config/environments/staging.rb index 9d110a9ca8..c6bc4902f3 100644 --- a/config/environments/staging.rb +++ b/config/environments/staging.rb @@ -55,7 +55,7 @@ Openfoodnetwork::Application.configure do # config.assets.precompile += %w( search.js ) require 'uglifier' - config.assets.js_compressor = Uglifier.new(mangle: false) + config.assets.js_compressor = Uglifier.new(mangle: false, harmony: true) # Disable delivery errors, bad email addresses will be ignored # config.action_mailer.raise_delivery_errors = false