You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 22, 2022. It is now read-only.
If I use Rails Sprockets I can simply add //= require_tree ./models to my application.js. Then I have access to App.Models.Monkey from within App.Models.Zoo out of the box (see example on top). Plain and simple!
Now gulp-rails-pipeline inspired me to ditch the Rails Asset Pipeline.
My question: How can I access my existing JavaScript classes within their namespace so that I can e.g. call new App.Models.Monkey("Charley") from App.Models.Zoo? (see the example on top)
Is there something simliar to require_tree for browserify? Is there something which allows me to simply leave all files as they are, bundle them to one big JS file AND references to e.g. App.Models.Monkey will somehow still magically work?
If not so: Is there some helper which can magically turn all of my classes into RequireJS modules?
Or do I need to turn all of my Models, Controllers, Routers, Views... into RequireJS modules manually (which will result in adding many module.exports and require statements)?