-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Load with requirejs #6
Comments
It is, but you have to wrap the root cryptojs file as described here |
Thanks for that, I ended up doing something like this: require.config({
modules: [
{
name: 'main'
}
],
paths: {
'crypto': "../components/cryptojs/lib/Crypto",
'crypto.BlockModes': "../components/cryptojs/lib/BlockModes",
'crypto.PBKDF2': "../components/cryptojs/lib/PBKDF2",
'crypto.HMAC': "../components/cryptojs/lib/HMAC",
'crypto.SHA1': "../components/cryptojs/lib/SHA1",
'crypto.AES': "../components/cryptojs/lib/AES"
},
shim: {
'crypto.AES': ['crypto','crypto.BlockModes','crypto.PBKDF2','crypto.HMAC','crypto.SHA1']
}
});
require([
'crypto.AES'
], function () {
Crypto.AES.encrypt('password', 'passphrase');
}); |
are you sure there aren't changes that could be made to this that could make it simply work by using packages support in requirejs http://requirejs.org/docs/api.html#packages ? without breaking commonjs support? |
I think it's probably important not to try to use |
Is possible to use load this lib with requirejs in frontend?
The text was updated successfully, but these errors were encountered: