I have jquery and jquery-cookie working together correctly below. I would like to make is so that jquery isn't global. Right now it is. Any method i've tried seems to break jquery-cookie.
require.config({
paths: {
"jquery": '../components/jquery/jquery',
"jquery-cookie": "../components/jquery-cookie/jquery.cookie",
},
shim: {
"jquery-cookie": {
deps: ['jquery']
}
}
});
require(["jquery", "jquery-cookie"], function($) {
console.log($().jquery); // 1.7.2
console.log($.cookie("hello")); // null
});
The following changes will make jquery local and break cookie:
define("nc-jquery",['jquery'], function () {
return jQuery.noConflict(true);
});
require(["nc-jquery", "jquery-cookie"], function($) {
console.log($().jquery);
console.log($.cookie("hello"));
});