-
-
Notifications
You must be signed in to change notification settings - Fork 448
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
feat: expose webpack target via babel caller #826
feat: expose webpack target via babel caller #826
Conversation
074e48a
to
d5483a1
Compare
|
@nicolo-ribaudo hmm. I thought it was resolved to a string by the time it got to the loader. Could very well be wrong on that though. I'm pretty sure |
Oh ok, I didn't know about it 👍 |
Yes it looks like it is resolved to a string since the |
d5483a1
to
a47605c
Compare
@DylanPiercey thanks! |
Is this working? I can't get anything other than |
@bpinto |
@DylanPiercey Is there a way to use webpack I was trying the following:
|
@bpinto I think it probably could be exposed as well, but it'd need to be a new property on the caller. Currently it is not exposed. |
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
What is the current behavior? (You can also link to an open issue here)
Currently it is not possible to determine inside of a
babel.config.js
file what the webpack target being bundled for is.What is the new behavior?
Exposes the current webpack target using the babel caller api.
Does this PR introduce a breaking change?
Other information:
I'm happy to add a test if necessary. However there are not existing tests for the already injected caller data. I think it'd require a bit of effort to setup correctly since we'd probably want to write a fake plugin which just checked what the caller was.
Implements #787