Skip to content

Commit

Permalink
Fix Uglifier::Error during production compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
cooperka committed Apr 18, 2024
1 parent 6a5ef3f commit 8524c02
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@
# Apache or NGINX already handles this.
config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present?

# Compress CSS using a preprocessor.
# config.assets.css_compressor = :sass

# Do not fallback to assets pipeline if a precompiled asset is missed.
config.assets.compile = false

Expand All @@ -43,7 +40,13 @@
value_max_bytes: 16.megabytes}

# Compress JavaScripts and CSS.
config.assets.js_compressor = Uglifier.new(harmony: true)
#
# Normally we would want to enable Harmony, but this seems to work regardless:
# https://github.com/lautis/uglifier/issues/185#issuecomment-1138334525
config.assets.configure do |env|
env.js_compressor = :uglifier
env.css_compressor = :sass
end

# For nginx:
config.action_dispatch.x_sendfile_header = "X-Accel-Redirect"
Expand Down

0 comments on commit 8524c02

Please sign in to comment.