Closed peduarte closed 11 years ago
Has anyone used this with Requirejs? I am struggling to get it to work.
This is what I have at the moment:
var require = { enforceDefine: true, paths: { 'jquery': '/js/vendor/jquery.min', 'hashchange': '/js/vendor/jquery.hashchange.plugin', }, shim: { 'jquery': { exports: '$' } 'hashchange': { deps: ['jquery'], exports: 'Hashchange' } } };
And this is how I define it later on:
define(['jquery', 'hashchange'], function ($, Hashchange) { // code });
Any tips will be very appreciated, Thanks!
Got it to work... problem was with the exports option in the shim: {};
exports
shim: {}
'hashchange': { deps: ['jquery'], exports: 'jQuery.fn.hashchange.' }
Has anyone used this with Requirejs? I am struggling to get it to work.
This is what I have at the moment:
And this is how I define it later on:
Any tips will be very appreciated, Thanks!