generates directive on `node_modules` directory
I'm trying to work out how to run
npm install
but only when the following is true: package.json
has been updated OR node_modules
directory doesn't exist.
I can make the first condition work but not both. Many thanks!2 Replies
@leaanthony This is what
sources
and generates
are for. You should be able to use them like this:
Thanks for the quick reply @pd93. I thought I'd done this and it kept triggering anyway. Turns out i had a typo in the path and so it didn't find it. Would be an interesting addition to check the generates path after running to see if it actually did generate and if not, issue a warning.
Anyway, happy to report it's working as expected 👍