-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, except for the comment below.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably should link to https://github.com/substack/node-resolve instead, since that is the module that is actually used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@RyanZim Updated!
@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