Add addModulesDirectories config#256
Conversation
Allows appending to the default list of modules directories. Relevant discussion: #195
|
Maybe we could refactor let resolveOpt = {} // defaults
if (typeof options.resolve === 'object') {
resolveOpt = Object.assign(resolveOpt, options.resolve)
resolveOpt.moduleDirectories.push('node_modules', 'web_modules')
}
if (typeof options.resolve === 'function') {
// Use custom resolver
} |
|
Neat, @michael-ciniawsky! Happy to change the PR to this approach. |
|
@michael-ciniawsky I like that idea, I just think using the If we go that direction, we should set For right now, I would be in favor of just doing it the way it is done in this PR. For the next major version, I would consider removing |
RyanZim
left a comment
There was a problem hiding this comment.
LGTM, except for the comment below.
README.md
Outdated
| Type: `Array` | ||
| Default: `[]` | ||
|
|
||
| An array of folder names to add to [Node's resolver](https://nodejs.org/api/modules.html#modules_loading_from_node_modules_folders). |
There was a problem hiding this comment.
Probably should link to https://github.com/substack/node-resolve instead, since that is the module that is actually used.
|
@neezer Thanks! |
|
It's not published yet? |
|
@renatorib It's not. I should publish it. I was planning on adding a few other things to the next release, but I haven't got around to it, so I guess I'll just publish this. I'll comment here as soon as I get it done. |
|
@renatorib @neezer Released: https://github.com/postcss/postcss-import/releases/tag/9.1.0. Sorry for the long wait. |
|
@neezer Yep, thanks. |
Allows appending to the default list of modules directories. I picked a name that I think sounds good, but happy to change it if y'all have something else you'd prefer. 😄
Relevant discussion: #195
@RyanZim