Skip to content

Commit

Permalink
Support webpacker for rails assets precompilation
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Akshay Birajdar committed Dec 24, 2019
1 parent 84fa84c commit 81935f9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tasks/mina/rails.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 81935f9

Please sign in to comment.