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

feat: add extensions option to vue-jsx plugin #1953

Merged
merged 2 commits into from
Apr 19, 2021

Conversation

Jokcy
Copy link
Contributor

@Jokcy Jokcy commented Feb 9, 2021

Add extensions option to vue-jsx plugin, so that some other plugin just need to output jsx to reuse vue-jsx plugin ability.

For example, I want to implement mdx plugin for vite, since mdx just compile markdown into jsx, I only need to do some vue3 related coding and leave jsx and hmr to vue-jsx plugin.

@yyx990803
Copy link
Member

I think it's better to follow the convention of Rollup plugins and use include/exclude instead (use createFilter from @rollup/pluginutils)

@Jokcy
Copy link
Contributor Author

Jokcy commented Feb 10, 2021

I think it's better to follow the convention of Rollup plugins and use include/exclude instead (use createFilter from @rollup/pluginutils)

Emm.... I think include/exclude is another approach, extensions and include/exclude may work together, something like:

extensions: ['.jsx', '.tsx', '.mdx'],
include: ['src']

instead of

include: ['src/**/*.jsx', 'src/**/*.tsx', 'src/**/*.mdx']

@Jokcy
Copy link
Contributor Author

Jokcy commented Mar 7, 2021

@yyx990803 I updated the PR to use rollup plugin utils, please review it.

packages/plugin-vue-jsx/index.js Outdated Show resolved Hide resolved
@antfu antfu added the p2-nice-to-have Not breaking anything but nice to have (priority) label Mar 15, 2021
@Jokcy
Copy link
Contributor Author

Jokcy commented Mar 19, 2021

So when to publish it?

@patak-dev patak-dev merged commit fbecf1e into vitejs:main Apr 19, 2021
TobiasMelen pushed a commit to TobiasMelen/vite that referenced this pull request May 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p2-nice-to-have Not breaking anything but nice to have (priority)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants