node-install-local icon indicating copy to clipboard operation
node-install-local copied to clipboard

Enhancement: only run on changed files

Open arobinson opened this issue 6 years ago • 1 comments

First, thank you for this, saving me from having to convert us from npm to yarn

I've hooked this up as a postinstall script in package.json:

    "postinstall": "npx install-local"

This is great in having it now install my local projects as dependencies. Now the drawback is that every npm install it re-packs and installs each of the local dependencies even when they haven't changed.

I'd love to have a build performance feature to allow this to work so that it only runs the install if needed. So if npx install-local is run without arguments (probably with a new flag like --freshen or --update?), it checks each of the localDependencies and only installs them if that destination has newer (or sha-sum changed) files compared to the local node_modules/* folder where it will be installed to.

arobinson avatar Jan 15 '20 20:01 arobinson

Hi @arobinson thanks for the praise and sorry for the late response.

How would this feature work exactly? In my experience npm install will automatically remove the "extraneous" dependencies (the local dependencies will be seen as extraneous). If so, then checking for changes won't work. 🤷‍♂️

nicojs avatar Oct 16 '20 17:10 nicojs