Skip to content
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

Support custom moduleDirectories #195

Closed
taion opened this issue Apr 21, 2016 · 11 comments
Closed

Support custom moduleDirectories #195

taion opened this issue Apr 21, 2016 · 11 comments

Comments

@taion
Copy link

taion commented Apr 21, 2016

In 7.x, the specified path(s) functioned as additional module directories.

I used this to follow the "huge apps" example in using nested shared/ directories, that were resolved as module directories.

Was there a specific reason for its removal? It's not a feature I've made heavy use of, but it seems like an odd removal. Is the idea that this feature is superseded by the custom resolve argument?

@MoOx
Copy link
Contributor

MoOx commented Apr 22, 2016

Is the idea that this feature is superseded by the custom resolve argument?

I think so. I have to admit I don't really use this package except for node_modules and web_modules.

@TrySound handled the 8.x release (huge refactoring). It seems there is some major issues tho like #168 so I may consider simply reverting to 7.x implementation (which is simpler and don't have this kind of bugs) since nobody is currently maintaining this package at the moment (and I found the current codebase more complicated, and API too low level).

@taion
Copy link
Author

taion commented Apr 22, 2016

FWIW, this ended up being easy to work around for me, since apparently I was only using the moduleDirectories thing for a single directory.

@RyanZim
Copy link
Collaborator

RyanZim commented Nov 9, 2016

it seems like an odd removal

Agreed.

I would be in favor of adding this back; however, I'm not sure of the best route to proceed. Should custom moduleDirectories replace or be appended to the default [ 'node_modules', 'web_modules' ]?

@MoOx @TrySound @ai Thoughts?

@MoOx
Copy link
Contributor

MoOx commented Nov 9, 2016

I would go for appending them. I guess nobody will want to remove those.

@RyanZim
Copy link
Collaborator

RyanZim commented Nov 9, 2016

I guess nobody will want to remove those.

Yeah, if they do, they can use resolve.

@neezer
Copy link
Contributor

neezer commented Nov 30, 2016

Voicing my support for this. I'm using the application structure outlined by @ryanflorence, which relies on being able to customize moduleDirectories. Unlike @taion, I am actually using this feature pretty heavily. 😉

In the meantime, I've just forked this repo and added the directory manually, which unblocks me until any official update.

@RyanZim
Copy link
Collaborator

RyanZim commented Nov 30, 2016

@neezer Thanks for chiming in. I want to get v9 shipped today or tomorrow; then this will be PR welcome for the next release.

@RyanZim
Copy link
Collaborator

RyanZim commented Dec 3, 2016

@neezer @taion v9 is shipped, PR welcome.

@taion
Copy link
Author

taion commented Dec 3, 2016

We ended up not using this pattern – the reason ended up being that we use CSS modules, for which modules directories support already works fine, and only used @import for variables. Those variables we wanted available in both CSS and JS anyway, so we ended up just declaring them all at top-level in JS for shared use across everything.

If you're using CSS modules, I'd recommend using https://github.com/css-modules/postcss-modules-values anyway.

@neezer
Copy link
Contributor

neezer commented Dec 3, 2016

@RyanZim Awesome! Not sure if I'll have time to throw up a PR for this, but I'll see what I can do.

RyanZim pushed a commit that referenced this issue Dec 16, 2016
* Add `addModulesDirectories` config

Allows appending to the default list of modules directories.

Relevant discussion:

#195
@RyanZim
Copy link
Collaborator

RyanZim commented Jan 10, 2017

Fixed in #256, released in v9.1.0.

@RyanZim RyanZim closed this as completed Jan 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants