Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Allow setting of maxBuffer for packing external modules #96

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/packExternalModules.js
Original file line number Diff line number Diff line change
@@ -94,13 +94,14 @@ module.exports = {
this.serverless.cli.log('Packing external modules: ' + prodModules.join(", "));

const tmpPackageJson = path.join(this.serverless.config.servicePath, 'package.json');

// create a temp package.json in dist directory so that we can install the dependencies later.
fs.writeFileSync(tmpPackageJson, "{}");

return new BbPromise((resolve, reject) => {
npm.install(prodModules, {
cwd: this.serverless.config.servicePath,
maxBuffer: this.serverless.service.custom.packExternalModulesMaxBuffer || 200 * 1024,
save: true
}).then(() => {
// fs.unlink(tmpPackageJson);
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@
"fs-extra": "^0.26.7",
"glob": "^7.1.2",
"lodash": "^4.17.4",
"npm-programmatic": "0.0.5",
"npm-programmatic": "^0.0.7",
"ts-node": "^3.2.0"
},
"devDependencies": {