From discussion in #1453
Npm-based formatters require an npm install call to prepare running the npm process for formatting.
It would be nice if we could speedup that part (or alltogether prevent it, if it is not needed).
Some ideas:
- Store the
node_modules-directory and package.json somewhere in build-folder and copy/link those on later calls.
- Similar, but more longevity: Store these folders/files somewhere in
$HOME/.cache/spotless/npm and reuse/copy/link them from there?
- Gradle-specific: Leverage gradle's build-cache by creating a gradle task that generates the
package.json and node_modules dir as (cachable) output. A second/third run would then just receive these files/folders from the build cache?