From 098b292c0f37a8f66d4ec283a8776bbf874c378c Mon Sep 17 00:00:00 2001 From: Sam Saffron Date: Thu, 11 Jun 2015 16:41:22 +1000 Subject: [PATCH] PERF: production assets not minified source url post processor forcing all scripts into an eval, minifier can not minify such files --- config/initializers/10-discourse_iife.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/config/initializers/10-discourse_iife.rb b/config/initializers/10-discourse_iife.rb index 73f343071f6..4df28e58c90 100644 --- a/config/initializers/10-discourse_iife.rb +++ b/config/initializers/10-discourse_iife.rb @@ -1,5 +1,7 @@ require 'discourse_iife' -require 'source_url' Rails.application.assets.register_preprocessor('application/javascript', DiscourseIIFE) -Rails.application.assets.register_postprocessor('application/javascript', SourceURL) +unless Rails.env.production? + require 'source_url' + Rails.application.assets.register_postprocessor('application/javascript', SourceURL) +end