Last active
December 16, 2015 12:59
-
-
Save brianjmiller/5438294 to your computer and use it in GitHub Desktop.
Loading CryptoJS with require/almond, etc.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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))); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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