plugins icon indicating copy to clipboard operation
plugins copied to clipboard

feat(node-resolve): add new option, modulePaths

Open ajhyndman opened this issue 3 years ago • 2 comments

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

ajhyndman avatar Feb 10 '22 00:02 ajhyndman

@tjenkinson please have a peek at this one

shellscape avatar Apr 11 '22 20:04 shellscape

@tjenkinson PR is awaiting your review of most recent changes in response to your comments. please take a look.

shellscape avatar Jun 10 '22 13:06 shellscape

thanks!

shellscape avatar Sep 12 '22 13:09 shellscape