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

no-duplicates rule with different webpack loaders #682

Closed
benmvp opened this issue Nov 29, 2016 · 5 comments
Closed

no-duplicates rule with different webpack loaders #682

benmvp opened this issue Nov 29, 2016 · 5 comments

Comments

@benmvp
Copy link

benmvp commented Nov 29, 2016

I have a file that has some imports like:

import TextInputErrorExampleCode from '!raw!./TextInputErrorExample';
import TextInputErrorExample from './TextInputErrorExample';

The no-duplicates rule is considering these to be the same import even though one is code and the other is text.

Is there a configuration of the webpack resolver I can use to combat this?

Thanks!

@ljharb
Copy link
Member

ljharb commented Nov 29, 2016

i'd recommend configuring webpack itself so that !raw! doesn't appear in your code (ie, don't use custom webpack syntax) and maybe do import TextInputErrorExampleCode from './TextInputErrorExample.raw';, and then configure the resolver for that extension.

@benmvp
Copy link
Author

benmvp commented Nov 29, 2016

I like that idea! Probably will do something like './TextInputErrorExample.js.raw so it could apply to any file, but I like it. Thanks!

@benmvp benmvp closed this as completed Nov 29, 2016
@benmosher
Copy link
Member

@benmvp are those not both referencing the same file?

@ljharb
Copy link
Member

ljharb commented Dec 16, 2016

@benmosher the implication i heard was that one provides the source code as text, the other parses it and provides its export.

@benmvp
Copy link
Author

benmvp commented Dec 16, 2016

Yep what @ljharb said. I ended up not able to try it out because the webpack config change would've taken longer than the time I had. I will circle back at some point!

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

No branches or pull requests

3 participants