Skip to content
This repository has been archived by the owner on Sep 15, 2023. It is now read-only.

Added resolve-root jsSrc #213

Merged
merged 1 commit into from
Oct 28, 2015
Merged

Added resolve-root jsSrc #213

merged 1 commit into from
Oct 28, 2015

Conversation

mathiasvalentin
Copy link
Contributor

Taking advantage of the configuration property resolve-root. http://webpack.github.io/docs/configuration.html#resolve-root
This makes file importing inside subfolders a little easier. See example:

Now use:
import Something from 'mydir/myfile';
Old way:
import Something from '../../mydir/myfile';

Taking advantage of the configuration property resolve-root. http://webpack.github.io/docs/configuration.html#resolve-root
This makes file importing inside subfolders a little easier. See example:

Now use:
import Something from 'mydir/myfile';
Old way:
import Something from '../../mydir/myfile';
@greypants
Copy link
Contributor

Let's do it. This is actually one of the oldest issues in the repo, from back when I was using browserify: #17

There was some worry about naming conflicts with installed node_modules...but that will rarely be an issue, and if it is, you can just go back to relative paths.

I'll try it locally quick before merging.

@greypants
Copy link
Contributor

@nhunzaker I noticed you were doing this for a while, and then stopped and are back to relative paths. I think I asked once but forgot... did you have concerns about this?

greypants pushed a commit that referenced this pull request Oct 28, 2015
[update] Added resolve-root jsSrc
@greypants greypants merged commit eaaafd3 into vigetlabs:master Oct 28, 2015
@greypants
Copy link
Contributor

👍

@mathiasvalentin mathiasvalentin deleted the patch-1 branch October 28, 2015 20:23
@mathiasvalentin
Copy link
Contributor Author

👍

@greypants
Copy link
Contributor

oh. I just bumped into why this can be problematic :/ Server-side rendering. I'm working on an isomorphic react app, and node doesn't know about my webpack config when I pull in those files. So just be aware of that. @nhunzaker I think I remember now you mentioning thats why you switched.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants