You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# lib/tasks/assets.rake
namespace :assets do
desc "Ensures that dependencies required to compile assets are installed"
task install_dependencies: :environment do
raise if File.exist?("package-lock.json") && !(system "npm install")
end
end
Rake::Task["assets:precompile"].enhance ["assets:install_dependencies"]
Sometimes, we always want to run some code, like
rake react_on_rails:generate_packs
whenever about to run webpack
We can add a
shakapacker.yml
configuration so some code can run before invoking the webpack.This way, "it just works" in terms of having some files ready that React on Rails needs.
Alternatives:
The text was updated successfully, but these errors were encountered: