requirejs-rails
requirejs-rails copied to clipboard
Map configuration in almond builds
Hi @jwhitley,
first of all thanks for your work on this project, it's been working great for me.
One thing I'm having trouble with though is using map in almond builds.
This is my requirejs.yml:
shim:
zepto:
exports: '$'
map:
'*':
jquery: 'zepto'
In development this works a treat, but if I create a production build with config.requirejs.loader = :almond set, I get a javascript error saying "backbone missing jquery".
Now I noticed that during development the requirejs_include_tag generates a requirejs runtime config based on requirejs.yml. It appears that it doesn't include this in the almond single file build, is that how it's supposed to work?
If I add the map config to my javascript manually like so it works:
c = {"map":{"*":{"jquery":"zepto"}}}
require.config(c)
Please let me know if you need any more information.
@pascalw Sorry for the belated reply. I am currently looking adding config information for almond.js builds. The cause of the issue is that the config information isn't populated in the first place.