Questions tagged [browserify-rails]

Browserify-rails library adds CommonJS module support to Sprockets.

Browserify-rails mix and match //= require directives and require() calls for including plain javascript files as well as modules.

16 questions
24
votes
1 answer

babelify + browserify-rails + react, Uncaught SyntaxError: Unexpected token import

I'm using browserify-rails + babelify to transpile jsx in a react + rails project. I'm very puzzled why // require(''); is needed in components.js (which is the mounting point of react) for the jsx transpilation to work. If I delete the line of…
Sida Zhou
  • 3,529
  • 2
  • 33
  • 48
8
votes
2 answers

How to use modified node module using github branch?

I'm using the rc-slider component in my application and had to add one feature to meet my needs. I forked the main repository and pushed my changes to this branch. In the application, I changed the package.json as below and ran the npm install…
Rodrigo
  • 5,435
  • 5
  • 42
  • 78
6
votes
1 answer

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…
kettlepot
  • 10,574
  • 28
  • 71
  • 100
3
votes
1 answer

Difference between sprockets //=require and browserify-rails require()?

With sprockets: //= require ...in application.js seems to add a