Skip to content
This repository has been archived by the owner on Aug 9, 2023. It is now read-only.

Commit

Permalink
Prevent webpack from hanging during staging
Browse files Browse the repository at this point in the history
Staging was hanging indefinitely when it started optimizing assets
(part of the `npm run build` postinstall script).

I didn't investigate fully, but it seems to be related to Node's poor
grasp of system resources[1,2,3].

One suspect was identified in the build output:

```
> npm run build (node:46) MaxListenersExceededWarning: Possible
  EventEmitter memory leak detected. 11 SIGINT listeners added. Use
  emitter.setMaxListeners() to increase limit
```

[1] webpack/webpack#2012 (comment)
[2] webpack/webpack#4558
[3] webpack-contrib/sass-loader#100
  • Loading branch information
henrytk committed Jul 4, 2018
1 parent ce3d7ab commit 7ed50d2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
applications:
- name: paas-hackmd
instances: 1
memory: 2G
memory: 6G
buildpack: nodejs_buildpack
env:
PGSSLMODE: require
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"jsonlint": "find . -not -path './node_modules/*' -type f -name '*.json' -o -type f -name '*.json.example' | while read json; do echo $json ; jq . $json; done",
"standard": "node ./node_modules/standard/bin/cmd.js",
"dev": "webpack --config webpack.config.js --progress --colors --watch",
"build": "webpack --config webpack.production.js --progress --colors --bail",
"build": "node --max-old-space-size=6144 node_modules/webpack/bin/webpack.js --config webpack.production.js --progress --colors --bail",
"postinstall": "npm run build",
"start": "node app.js",
"doctoc": "doctoc --title='# Table of Contents' README.md"
Expand Down

0 comments on commit 7ed50d2

Please sign in to comment.