Trying to browserify my node code for use in lambda to help combat the cold start issues (which also raises the ceiling on the hard 50MB zipped limit).
Is browserfying for node not supported? Ultamately I'd like to just use the --node browserify option, but its not working.
Ex: (I wont be hard coding creds, this is just for ease of reproduce.)
var AWS = require('aws-sdk');
AWS.config.update({
accessKeyId: 'mykey',
secretAccessKey: 'mysecret'
});
var s3 = new AWS.S3();
s3.listBuckets(function(err, data) {
console.log(err, data);
});
If I run browserify bundletests.js > bundled.js then run node bundle.js I get XMLHttpRequest is not defined which is expected since I'm not running in the browser.
So I run browserify bundletests.js --dg --no-builtins --no-commondir > bundled.js to not use the builtins and I get
module.js:340
throw err;
^
Error: Cannot find module '_process'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at s (/Users/ryan/projects/JAWS/tests/bundle/testapp/myLambda/bundled.js:1:176)
Any ideas?
Trying to browserify my node code for use in lambda to help combat the cold start issues (which also raises the ceiling on the hard 50MB zipped limit).
Is browserfying for node not supported? Ultamately I'd like to just use the
--nodebrowserify option, but its not working.Ex: (I wont be hard coding creds, this is just for ease of reproduce.)
If I run
browserify bundletests.js > bundled.jsthen runnode bundle.jsI getXMLHttpRequest is not definedwhich is expected since I'm not running in the browser.So I run
browserify bundletests.js --dg --no-builtins --no-commondir > bundled.jsto not use the builtins and I getAny ideas?