royriojas/persistify

Move browserify/watchify to dev dependencies

Closed this issue · 4 comments

Because browserify and watchify are dependencies of persistify, it will always use those modules. This makes using your own version of browserify and watchify impossible. Likewise, any time a newer version of browserify or watchify is released (not uncommon at all), this project needs to update its own dependencies (as with #6)

It seems like the best course of action would be to not list browserify or watchify as dependencies at all, and instead trust that whoever is using this module has those modules installed themselves. That gives the users of this module much more freedom. They would still need to be listed as dev dependencies for testing purposes, but would not be installed in production environments.

Hi @boblauer it totally makes sense. Would you like to make a PR for it? would be more than happy to approve and publish.

Awesome, will do.

Shouldn't they be peer dependencies?
https://nodejs.org/en/blog/npm/peer-dependencies/

PS: browserify is now at version 14 :)

I just made a pull request to update to the latest versions of browserify and watchify. Tested it on my project and keeps working.

#14

PS: it could be done with peerDependencies set to "*", but then if you don't have either of them installed and try to run persistfy from the CLI it would just crash (although the npm install gives a warning), so I'm not really sure if it is the best course of action.

The error that would show with peerDependencies is

npm WARN persistify@1.1.1 requires a peer of browserify@* but none was installed.
npm WARN persistify@1.1.1 requires a peer of watchify@* but none was installed.