srs / gradle-node-plugin

Gradle plugin for integrating NodeJS in your build. :rocket:
Apache License 2.0
864 stars 212 forks source link

Support putting cacheDir into rootProject #247

Open remmeier opened 7 years ago

remmeier commented 7 years ago

in Gradle project having multiple npm/node projects, each project currently gets its own node installation. There should be a possiblity to setup the cacheDir in the rootProject to reuse a single node installation.

Ideally the plugin can be applied to the root project with all the configuration settings (versions, etc.) and all other project will just make use of that.

mgillmann commented 7 years ago

You can do this to set the npm cache location: task setNpmCache(type: NpmTask) { // set the npm cache location args = ['config', 'set', 'cache', "${buildDir}/npmcache"] }

See this stack overflow link: https://stackoverflow.com/questions/14836053/how-can-i-change-the-cache-path-for-npm-or-completely-disable-the-cache-on-win