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
@vitejs/plugin-react can support more extensions #22
Comments
please give more details. |
@Niputi export default () => <div> {/* The transformed code */}</div> However, This is my current configuration file: plugins: [
vitePluginDocs(), // my markdown transform plugin
babel({
extensions: ['.md'],
configFile: false,
presets: [['@babel/preset-react', { runtime: 'automatic' }]],
babelHelpers: 'bundled'
})
viteReact()
] I want the plugins: [
vitePluginDocs(), // my markdown transform plugin
viteReact({ extensions: ['.tsx', '.md'], })
] So I can remove the babel from my config. |
By reading the plugin's code, I found that the plugin will only convert |
|
@bluwy I think it's a nice feature, so what do you think? |
I'm not familiar with React (nor the vite plugin) so I can't say for sure if there are caveats to this. @aleclarson might know more about it. |
Hi! |
Clear and concise description of the problem
I'm doing markdown conversion to React component. However, this plugin may only be supported
.jsx?
or.tsx?
file. So I had to use an extra Babel plugin to handle the files generated by the markdown transformation.Suggested solution
Add a configuration extension to the plugin's options and support any text that conforms to React component.
Alternative
No response
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: