Skip to content

Instantly share code, notes, and snippets.

@brianjmiller
Last active December 16, 2015 12:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brianjmiller/5438294 to your computer and use it in GitHub Desktop.
Save brianjmiller/5438294 to your computer and use it in GitHub Desktop.
Loading CryptoJS with require/almond, etc.
var CryptoJS = CryptoJS || (function (Math, undefined) {^M
^M
return C;^M
}(Math));^M
define("cryptojs", (function (global) {
return function () {
var ret, fn;
return ret || global.CryptoJS;
};
}(this)));
require.config({
baseUrl: "../src",
paths: {
// App deps
"jquery": "../components/jquery/jquery",
"jquery.cookie": "../components/jquery.cookie/jquery.cookie",
"underscore": "../components/underscore-amd/underscore",
"backbone": "../components/backbone-amd/backbone",
"handlebars": "../components/handlebars/handlebars.runtime",
// Dev / Test deps
"chai": "../components/chai/chai",
"test": "../test",
// Include bootstrap as a shim as it doesn't support AMD. See PR at https://github.com/twitter/bootstrap/pull/534
"bootstrap": "../components/bootstrap/docs/assets/js/bootstrap",
"cryptojs": "../vendor/cryptojs-v3.0.2/components/core",
"cryptojs-enc-base64": "../vendor/cryptojs-v3.0.2/components/enc-base64"
},
shim: {
'handlebars': {
exports: 'Handlebars'
},
'bootstrap': {
deps: ['jquery']
},
'cryptojs': {
exports: 'CryptoJS'
//init: function () {
//return CryptoJS;
//}
},
'cryptojs-enc-base64': {
deps: ['cryptojs']
}
},
urlArgs: "bust=" + (new Date()).getTime() // cache-busting for development
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment