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

Access Resource Query in Plugins? #916

Open
jantimon opened this issue Sep 30, 2021 · 1 comment
Open

Access Resource Query in Plugins? #916

jantimon opened this issue Sep 30, 2021 · 1 comment

Comments

@jantimon
Copy link

jantimon commented Sep 30, 2021

Especially when files contain javascript and css it might be necessary to process the file twice.
One time for javascript and one time for css.

Is there any way to access the webpack resource query inside a babel plugin?

For example here:

import { foo } from "./demo?extractOnlyCss"
import { bar } from "./demo"

Could a babel plugin process ./demo twice and know about ?extractOnlyCss?

@satouriko
Copy link

Eager to have this. Discuss if we should add the resourceQuery to filename or provide some new option to plugins. I'm open to contribute a pr.

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