This repository has been archived by the owner on Jan 25, 2023. It is now read-only.
Allow cache file glob customization #714
Labels
type: feature
code contributing to the implementation of a feature and/or user facing functionality
Hello! Netlify is the π 's π§ββοΈ s. Thanks for maintaining it.
This issue relates to a chronic problem I encounter maintaining NodeJS builds using
npm
(oryarn
), for example, an app might specifynpm run build
as it's build command for the netlify runner.The problem occurs when I use patch-package to maintain patches against my
node_modules
dependencies. If you are unaware,patch-package
is a node module which, when run against a package name, creates diff files inpatches/*.patch
that reflect the project maintainer's changes to her dependencies. An example workflow:npm install slidem
node_modules/slidem/**/*.js
npx patch-package slidem
patches/slidem+1.2.8.patch
, which is a git diff between the canonicalslidem@1.2.8
and maintainer's changes"postinstall": "patch-package"
to the project's root package.jsonpostinstall
runs, it applies the patch created earlier.The problem with this workflow is that the
node_modules
are cached, even if the patch file changes. This typically has one of two effects:patch-package
fails with non-0 exit code, failing the buildI described this problem in a support forum thread where @fool kindly offered some suggestions.
I believe that in the second case I listed, his API-call approach will still fail, so the best solution is one in which the user can optionally specify additional files to consider when deciding whether-or-not to bust the cache. i.e. the netlify user should be allowed to specify that changes in
patches/*.patch
should invalidate the cache just as changes inpackage-lock.json
do.Would you be interested in reviewing a PR to that effect?
See also #281 #113
The text was updated successfully, but these errors were encountered: