Skip to content

Fixed webpack config for windows #1

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

Merged
merged 1 commit into from
Apr 25, 2019

Conversation

AlwaysMoreHats
Copy link
Contributor

Windows' local path separator is '' instead of '/', which is what the node modules use. When indexing the alias, using path.join will make it (e.g.) 'app\LoginForm' on Windows only instead of the correct alias 'app/LoginForm'

@AlwaysMoreHats
Copy link
Contributor Author

You could instead do path.posix.join('app', name) in place of the interpolated string, but it won't remove windows separators from name if they exist. The safest way would be .replace('\\', '/') but because there are no sub routes and you only used the base name, it's not needed here. I think the interpolated string is the cleanest solution.

@mjackson mjackson merged commit acda410 into ReactTraining:master Apr 25, 2019
@mjackson
Copy link
Member

Thanks, @AlwaysMoreHats! This is invaluable.

CrystalCo added a commit to CrystalCo/hooks-workshop that referenced this pull request May 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants