From 81935f978c311e0b6908aa638a8b8ab3ad09693f Mon Sep 17 00:00:00 2001 From: Akshay Birajdar Date: Wed, 25 Dec 2019 00:33:27 +0530 Subject: [PATCH] Support webpacker for rails assets precompilation In Rails 6, Webpacker is the default JavaScript compiler. This commit add app/javascript/ to asset_dir as it is the default directory used by Webpacker. --- tasks/mina/rails.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tasks/mina/rails.rb b/tasks/mina/rails.rb index bd07d6de..a673bc41 100644 --- a/tasks/mina/rails.rb +++ b/tasks/mina/rails.rb @@ -5,11 +5,11 @@ set :bundle_prefix, -> { %{RAILS_ENV="#{fetch(:rails_env)}" #{fetch(:bundle_bin)} exec} } set :rake, -> { "#{fetch(:bundle_prefix)} rake" } set :rails, -> { "#{fetch(:bundle_prefix)} rails" } -set :compiled_asset_path, 'public/assets' -set :asset_dirs, ['vendor/assets/', 'app/assets/'] +set :compiled_asset_path, ['public/assets', 'public/packs'] +set :asset_dirs, ['vendor/assets/', 'app/assets/', 'app/javascript/'] set :migration_dirs, ['db/migrate'] -set :shared_dirs, fetch(:shared_dirs, []).push('log', 'tmp/cache', fetch(:compiled_asset_path)) +set :shared_dirs, fetch(:shared_dirs, []).push('log', 'tmp/cache', *fetch(:compiled_asset_path)) desc 'Starts an interactive console.' task :console do