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 2 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
@@ -31,7 +31,7 @@
"body-parser": "^1.15.2",
"express": "^4.14.0",
"fs-extra": "^0.26.7",
"npm-programmatic": "0.0.5",
"npm-programmatic": "^0.0.7",
"webpack": "^1.13.1"
Copy link
Contributor

@hassankhan hassankhan Jun 30, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't hardcode a Webpack dependency since #83 means a user has to install Webpack as a peer dependency.

},
"devDependencies": {