jwhitley / requirejs-rails

RequireJS support for your Rails 3 or 4 application
MIT License
592 stars 202 forks source link

Invoke rake directly #287

Closed kevinluo201 closed 3 years ago

kevinluo201 commented 3 years ago
  1. invoke requirejs:precompile:all by rake chain directly to avoid open a new process to execute it, so it's easier to track while deploying by Capistrano
  2. use Sprockets::Railtie.build_environment(Rails.application, true) to build Rails.application.assets when it's nil

I suggest not to include node_modules in the Sprockets assets paths in the assets.rb; otherwise, it'll compile all node_modules js file. Use stylesheet_pack_tag to include the csss in node_modules instead.