Sha256: 1d175a5b7cdf5058e4007044adae0f09d4388c92a00183e955b3e3d2a2e87d2a
Contents?: true
Size: 738 Bytes
Versions: 6
Compression:
Stored size: 738 Bytes
Contents
# lib/tasks/assets.rake # The webpack task must run before assets:environment task. # Otherwise Sprockets cannot find the files that webpack produces. # This is the secret sauce for how a Heroku deployment knows to create the webpack generated JavaScript files. Rake::Task["assets:precompile"] .clear_prerequisites .enhance(["assets:compile_environment"]) namespace :assets do # In this task, set prerequisites for the assets:precompile task task compile_environment: :webpack do Rake::Task["assets:environment"].invoke end desc "Compile assets with webpack" task :webpack do sh "cd client && npm run build:production" end task :clobber do rm_r Dir.glob(Rails.root.join("app/assets/webpack/*")) end end
Version data entries
6 entries across 6 versions & 1 rubygems