feat(node-resolve): add new option, modulePaths
Rollup Plugin Name: plugin-node-resolve
This PR contains:
- [ ] bugfix
- [x] feature
- [ ] refactor
- [x] documentation
- [ ] other
Are tests included?
- [x] yes (bugfixes and features will not be merged without tests)
- [ ] no
Breaking Changes?
- [ ] yes (breaking changes will not be merged unless absolutely necessary)
- [x] no
If yes, then include "BREAKING CHANGES:" in the first commit message body, followed by a description of what is breaking.
List any relevant issue numbers:
Description
This change introduces a new option for @rollup/plugin-node-resolve: modulePaths.
Unlike moduleDirectories, modulePaths allows the user to specify an absolute path to alternative locations (in addition to the importer's local directory) that should be searched for node modules.
This can be useful (for example) to support a CI system that caches node_modules in a non-standard location.
In node, this is supported via the NODE_PATH environment variable. Conveniently, this also brings @rollup/plugin-node-resolve into alignment with Jest's configuration options. See: https://jestjs.io/docs/configuration#modulepaths-arraystring
@tjenkinson please have a peek at this one
@tjenkinson PR is awaiting your review of most recent changes in response to your comments. please take a look.
