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

babelrc config not used #50

Open
kkroboth opened this issue Dec 18, 2017 · 1 comment
Open

babelrc config not used #50

kkroboth opened this issue Dec 18, 2017 · 1 comment

Comments

@kkroboth
Copy link

In version 3.0.1 this PR #38 disabled babelrc file configs which doesn't compile my code correctly.

Aside from the compact option, I also added the filename option to assist in debugging Babel messages like the one I encountered (without the filename, it falls back to "unknown"). Adding filename means we also have to set babelrc: false to prevent it from trying to look up an external config file (which can interfere with inject-loader).

Does this option need to be false or is there another way to include my babel config? Using the env option in babelrc we can set up a different environment for testing that doesn't interfere with "filename".

@seanparmelee
Copy link
Collaborator

Sorry @kkroboth, I just happened to notice this issue now, but is this still an issue for you?

After setting the filename to the file that's being injected, babel will try to look up its config starting from that folder and moving up the hierarchy. I was worried that it might cause a babel config to get picked up unexpectedly.

I too now have a use case for wanting inject-loader to use a particular babel config and I'm not sure if there's a better way to specific a config than reverting the babelrc: false. I was thinking about adding options to inject-loader, but I think the only way to pass them in would be to append them to your inject-loader!... requests which is tedious.

Curious to hear your thoughts on this @plasticine

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

No branches or pull requests

2 participants