browserify-rails

Requiring a sprockets-preprocessed file with Browserify and browserify-rails

大兔子大兔子 提交于 2019-12-06 00:34:00
问题 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

Requiring a sprockets-preprocessed file with Browserify and browserify-rails

徘徊边缘 提交于 2019-12-04 06:53:53
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 the application. I would like to be able to do something like var rr = require("./system/rails_routes.js