-
Notifications
You must be signed in to change notification settings - Fork 800
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Skip node_modules entirely. Fixes #54 by omitting path separator
- Loading branch information
Showing
1 changed file
with
2 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
f7190cf
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.
This is problematic for my setup. I have my code directory symlinked to the node_modules/myapp (nice names, importable from different places). Obviously this causes hot loading to stop working for all my react components.
f7190cf
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.
@rafales one option would be to move your code out of
node_modules
and into a new folder, e.g.local_modules
or something. Then you can just set resolve.modulesDirectory in your webpack config to include that folder (e.g.["local_modules", "web_modules", "node_modules"]
)You shouldn't have to change any of your code as
require('myapp/someModule')
would look insidelocal_modules
just like it does withnode_modules
by default.f7190cf
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.
@rafales I'd like to make a breaking change that asks people to configure
exclude
on their own (normally putnode_modules
in there). Before that, maybe we need to go the ugly way and explicitly test bothnode_modules/react
andnode_modules/webpack
with Unix and Windows separators. Would you file an issue for this?f7190cf
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.
@gaearon done
f7190cf
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.
btw @jRiest I really like that trick with
local_modules
. Will use this for development.