Requiring a sprockets-preprocessed file with Browserify and browserify-rails
问题 I'm using browserify-rails and I'm trying to get sprockets to preprocess a file that contains a sprockets directive, so that when I require() it using browserify, it will contain the generated JavaScript. The sprockets directive tries to include the output of the gem js-routes, in order to allow me to access the Rails routes from the clientside. This is my setup (within app/assets/javascripts ): system/ rails_routes.js application.js application.js is the main file, and it runs the rest of