aws4-crypto
crypto drop in replacement for aws4 module based on sjcl. the goal is to reduce the bundle size of aws4 package while used in browser.
install
npm install aws4-crypto --save
webpack usage
moduleexports = ... resolve: ... alias: ... crypto: 'aws4-crypto' ... ... ...
Due to internal usage of sjcl, in order not to bundle crypto-browserify, add to config:
moduleexports = ... module: noParse: /sjcl-aws/ // it requires crypto so webpack will bundle the browserified version. if the require fails it fallback to the browser api. ... ...
additional steps can be taken in order to reduce the aws4 package bundle size in browser
npm install url-lite --savenpm install null-loader --save-dev
add to webpack config:
moduleexports = ... resolve: ... alias: ... url: 'url-lite' // aws4 uses url ... ... module: ... rules: test: path // aws4 uses querystring-browser which requires it but it has no usage use: loader: 'null-loader' ... ... ...
license
MIT