Skip to content
This repository has been archived by the owner on Apr 9, 2020. It is now read-only.

Resolving imports paths with enabled preloaders #12

Closed
alexkuz opened this issue Sep 7, 2015 · 7 comments
Closed

Resolving imports paths with enabled preloaders #12

alexkuz opened this issue Sep 7, 2015 · 7 comments

Comments

@alexkuz
Copy link
Contributor

alexkuz commented Sep 7, 2015

If I have a preloader in webpack.config, such as:

preLoaders: {
    { test: /\.jsx?$/, loader: 'eslint', exclude: /node_modules/ }
}

then the loader's filename is included in filepath (/Users/.../eslint-loader/index.js!/Users/.../Component.jsx). I guess we should split filepath with "!" and use the last part of it.

@gaearon
Copy link
Owner

gaearon commented Sep 7, 2015

Seems very specific to Webpack, while the plugin isn't related to it per se.
Any other ideas?

@alexkuz
Copy link
Contributor Author

alexkuz commented Sep 7, 2015

May be there are some other, more reliable parameters in file, I can investigate it later

@alexkuz
Copy link
Contributor Author

alexkuz commented Sep 8, 2015

@gaearon turned out it's kinda babel-loader's fault. It seems it should provide original resource path instead of making concatenated path (see discussion here https://babeljs.slack.com/messages/plugins/)

@gaearon
Copy link
Owner

gaearon commented Sep 16, 2015

Is this same as gaearon/react-transform-boilerplate#15?

@alexkuz
Copy link
Contributor Author

alexkuz commented Sep 16, 2015

yeah, looks like it is

I guess we should file an issue to babel-loader and ask if we could replace this call with a plain file path

https://github.com/babel/babel-loader/blob/master/index.js#L31

@gaearon
Copy link
Owner

gaearon commented Sep 16, 2015

I'm sure they'll appreciate a PR!

@gaearon gaearon closed this as completed Sep 23, 2015
@gaearon
Copy link
Owner

gaearon commented Sep 23, 2015

Closing, as it's not actionable here.

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

No branches or pull requests

2 participants