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

Why is it necessary to keep the original JSX? #16

Open
Codpoe opened this issue Dec 29, 2023 · 3 comments
Open

Why is it necessary to keep the original JSX? #16

Codpoe opened this issue Dec 29, 2023 · 3 comments

Comments

@Codpoe
Copy link

Codpoe commented Dec 29, 2023

// We keep the origin jsx here.
// swc_util_build_jsx(&mut program, &build_options, Some(&location)).unwrap();

But there is jsx field in the Options struct:

/// Whether to keep JSX (default: `false`).
///
/// The default is to compile JSX away so that the resulting file is
/// immediately runnable.
pub jsx: bool,

@sanyuan0704
Copy link
Collaborator

To ensure the hmr runtime code injection by Rspack so we need to pass the original jsx code to it.

@Codpoe
Copy link
Author

Codpoe commented Jan 9, 2024

To ensure the hmr runtime code injection by Rspack so we need to pass the original jsx code to it.

But we could have controlled whether to retain jsx through the jsx: bool configuration option.

@sanyuan0704
Copy link
Collaborator

Yeah, we can expose the jsx option outside

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