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

in webpack resolve.alias should be resolve.root #28

Closed
wassname opened this issue Apr 5, 2016 · 2 comments
Closed

in webpack resolve.alias should be resolve.root #28

wassname opened this issue Apr 5, 2016 · 2 comments

Comments

@wassname
Copy link

wassname commented Apr 5, 2016

Here is a suggestion for an improvement to webpack config. Replace resolve.alias with resolve.root.

Why? Alias is bad because it applied to all imports, and in the current state is adds an extra slash breaks some imports.

E.g. importing 'helpers/actions/ActionWrapper.js' would convert to 'helpers/actions//ActionWrapper.js'

Or am I missing something about the reason it was used?

Instead, add to the search path using resolve.root.

PR submitted.

@weblogixx
Copy link
Member

Hi @wassname,

I will certainly have a look at it and give it a try. The problem with the double slashes was known, I just did not know the cause of it. Thanks for your support!

@weblogixx weblogixx added this to the 2.0 milestone Apr 13, 2016
@weblogixx
Copy link
Member

Hi @wassname,

the Idea itself is nice, but I run into errors when trying it out. Seems like we would have to change the way requires are inserted for css and other files. I will try to include this in the next major version of the package (2.0.0), which will include some breaking changes (unit testing via enzyme and other stuff).

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

2 participants