Sha256: 151d06e79d1a2d4c17907a0b058668930503e0b1a176afeaaf0a7cbc44760628

Contents?: true

Size: 835 Bytes

Versions: 11

Compression:

Stored size: 835 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:client"
    <%- if options[:server_rendering] -%>
    sh "cd client && npm run build:server"
    <%- end -%>
  end

  task :clobber do
    rm_r Dir.glob(Rails.root.join("app/assets/webpack/*"))
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
react_on_rails-5.2.0 lib/generators/react_on_rails/templates/base/base/lib/tasks/assets.rake.tt
react_on_rails-5.1.1 lib/generators/react_on_rails/templates/base/base/lib/tasks/assets.rake.tt
react_on_rails-5.1.0 lib/generators/react_on_rails/templates/base/base/lib/tasks/assets.rake.tt
react_on_rails-5.0.0 lib/generators/react_on_rails/templates/base/base/lib/tasks/assets.rake.tt
react_on_rails-5.0.0.rc.1 lib/generators/react_on_rails/templates/base/base/lib/tasks/assets.rake.tt
react_on_rails-4.0.3 lib/generators/react_on_rails/templates/base/base/lib/tasks/assets.rake.tt
react_on_rails-4.0.2 lib/generators/react_on_rails/templates/base/base/lib/tasks/assets.rake.tt
react_on_rails-4.0.1 lib/generators/react_on_rails/templates/base/base/lib/tasks/assets.rake.tt
react_on_rails-4.0.0 lib/generators/react_on_rails/templates/base/base/lib/tasks/assets.rake.tt
react_on_rails-4.0.0.beta.3 lib/generators/react_on_rails/templates/base/base/lib/tasks/assets.rake.tt
react_on_rails-4.0.0.beta.2 lib/generators/react_on_rails/templates/base/base/lib/tasks/assets.rake.tt