From 39e0092c224cc710938eff7e3820ed8a4a28e225 Mon Sep 17 00:00:00 2001 From: f Date: Fri, 13 Sep 2019 17:26:54 -0300 Subject: [PATCH] comprimir js --- Dockerfile | 2 +- config/environments/production.rb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index da4de15a..c3fd0072 100644 --- a/Dockerfile +++ b/Dockerfile @@ -46,7 +46,7 @@ COPY --chown=app:www-data ./config/credentials.yml.enc ./config/ # Pre-compilar los assets RUN bundle exec rake assets:precompile # Comprimirlos usando brotli -RUN find public/assets -type f -name "*.gz" | sed -re "s/\.gz$//" | xargs -r brotli -k -9 +RUN find public -type f -name "*.gz" | sed -re "s/\.gz$//" | xargs -r brotli -k -9 # Eliminar la necesidad de un runtime JS en producción, porque los # assets ya están pre-compilados. diff --git a/config/environments/production.rb b/config/environments/production.rb index 9028c2bb..73a3719d 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -29,6 +29,7 @@ Rails.application.configure do # Compress CSS using a preprocessor. config.assets.css_compressor = :sass + config.assets.js_compressor = Uglifier.new(harmony: true) # Do not fallback to assets pipeline if a precompiled asset is missed. config.assets.compile = false