rivets
rivets copied to clipboard
AMD (requirejs) with rivets.bundled not working correctly
With rivets.bundled — http://jsfiddle.net/meeg211u/
With separated rivets and sightglass — http://jsfiddle.net/r46ym8fz/
I can confirm this behavior. I have also had to shim them to get it working with sep libraries:
shim: {
sightglass : {
exports: 'sightglass'
},
rivets : {
deps : ['sightglass'],
exports : 'rivets'
}
}
I can also confirm this behavior. Methods and properties such as rivets.configure and rivets.formatters are undefined. @Duder-onomy's solution worked for me as well.
Thanks I was having this issue too, will include seperately
one thing I am confused about with RequireJS
should it be
shim: {
sightglass : {
exports: 'Sightglass'
},
rivets : {
deps : ['sightglass'],
exports : 'Rivets'
}
}
or
shim: {
sightglass : {
exports: 'sightglass'
},
rivets : {
deps : ['sightglass'],
exports : 'rivets'
}
}
or does it make a difference?
@ORESoftware In require.js, when shimming a dependency, the word you use to reference the dependency should be the same word defined in your paths.
if you had this in your require config:
paths : {
angular : '/angular/is/totally/lame'
}
Then you would need to refer to it in your deps as 'angular'. You could have made it uppercase, or named it something totally ridiculous like hammerHeadCottonWillowsForLyfe and that is what it will be called in your application. That is also the word you would use in the define block of your modules.
The exports property of the shim is what require.js uses to name the dependencies export. More info on that here.
Please let us know if that unblocks you. Cheers.