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

Is it possible to configure this plugin to support automatic jsx runtime? #100

Closed
xzilja opened this issue Jan 29, 2021 · 2 comments
Closed

Comments

@xzilja
Copy link

xzilja commented Jan 29, 2021

Ever since react 17 was release, following became optional when using jsx elements

import React from "react";

I looked around, it seems esbuild supports it via injection evanw/esbuild#334 and babel supported it via @babel/preset-react runtime option.

is it possible to achieve this using esbuild-loader plugin?

@privatenumber
Copy link
Owner

The inject option isn't available in esbuild's transform API (which is what this loader uses).

In Webpack, you can use the ProvidePlugin

Related: #92

@xzilja
Copy link
Author

xzilja commented Jan 29, 2021

Alright, thank you

@xzilja xzilja closed this as completed Jan 29, 2021
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