Robert Fletcher

Results 145 comments of Robert Fletcher

Makes sense, thanks for the lesson. A lot of stuff is global in the current application already, so might stick with that approach for the time being and start scoping...

We ended up keeping things that needed this behavior on the global scope until we were able to remove all of the sprockets requires.

@PikachuEXE you can still use `require()`, but you need to do some workaround to make it work until you get rid of all the sprockets requires. In a lot of...

@PikachuEXE ah, yeah. We ran into that, too. We ended up assigning all of those to the global scope as well: ```js // application.js window.underscore = require('underscore'); // elsewhere.js var...

That looks like it'll work so that your dependencies are loaded first. Otherwise, you can add them to `application.js` and do a `//= require_self` as the first require. One piece...

(Slightly updated snippet in comment, so you may want to take another look.)

I'll give that a try. Do you need to actually detect es6, though? Can't you just pipe all of the assets through the transforms?

Hmm, but I've got a `require()` in my `application.js`. It causes the required file to run through the transforms, but not `application.js`.

adding `// require` at the top of `application.js` did the trick for me.

Hmm, nevermind. That is no longer working, nor is `// module.exports`. Going to keep playing around with it.