endel / increase-memory-limit

Increase memory limit for local node binaries ("max-old-space-size")
http://npmjs.com/package/increase-memory-limit
MIT License
267 stars 26 forks source link

Possible to run from npm task? #6

Closed PTC-JoshuaMatthews closed 7 years ago

PTC-JoshuaMatthews commented 7 years ago

I'm having trouble figuring out how to integrate this with my npm tasks. Was hoping each dev wouldn't have to run this for each project, but instead to add a call to it to my build-prod task so this runs first. Also need to override the limit as my app needs 1200+. Any help appreciated!

endel commented 7 years ago

Hey @PTC-JoshuaMatthews,

You can do something like this:

  "scripts": {
    "fix-memory-limit": "cross-env LIMIT=2048 increase-memory-limit"
  },
  "devDependencies": {
    "increase-memory-limit": "^1.0.3",
    "cross-env": "^5.0.5",
  }
npm run fix-memory-limit
endel commented 7 years ago

Added these instructions to the README. Feel free to re-open this issue if you'd like to.

snapnurse-joshuamatthews commented 7 years ago

Very slick! Thank you!