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 mdx as known js source #14560

Merged
merged 1 commit into from
Oct 16, 2023
Merged

feat: add mdx as known js source #14560

merged 1 commit into from
Oct 16, 2023

Conversation

bluwy
Copy link
Member

@bluwy bluwy commented Oct 9, 2023

Description

Alternative to #14424

@markdalgleish does this work for your usecase?

Additional context


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Co-authored-by: Mark Dalgleish <mark.john.dalgleish@gmail.com>
@ArnaudBarre
Copy link
Member

Do people use .mdx to generate html directly?

@bluwy
Copy link
Member Author

bluwy commented Oct 15, 2023

I don't think so. MDX is officially supported to compile to js/jsx, and converting to html is another step on the framework level. Similar to the other extensions in the list like .astro and .svelte, those are mapped to HTML pages but internally they're compiled to js.

@markdalgleish
Copy link
Contributor

@bluwy If this means that import * from '/path/to/file.mdx' in a script tag that Vite doesn't control responds with JS rather than raw MDX, then yes, this will work for us.

@bluwy bluwy added the p2-nice-to-have Not breaking anything but nice to have (priority) label Oct 16, 2023
@bluwy bluwy added this to the 5.0 milestone Oct 16, 2023
@patak-dev
Copy link
Member

/ecosystem-ci run

@vite-ecosystem-ci
Copy link

vite-ecosystem-ci bot commented Oct 16, 2023

📝 Ran ecosystem CI: Open

suite result
analogjs ✅ success
astro ✅ success
histoire ✅ success
ladle ✅ success
laravel ✅ success
marko ✅ success
nuxt ✅ success
nx ❌ failure
previewjs ✅ success
qwik ❌ failure
rakkas ✅ success
sveltekit ✅ success
unocss ✅ success
vike ✅ success
vite-plugin-pwa ✅ success
vite-plugin-react ✅ success
vite-plugin-react-pages ✅ success
vite-plugin-react-swc ✅ success
vite-plugin-svelte ✅ success
vite-plugin-vue ❌ failure
vite-setup-catalogue ✅ success
vitepress ✅ success
vitest ✅ success

Copy link
Member

@patak-dev patak-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ecosystem-ci looks good, let's test this change during the beta

@patak-dev patak-dev merged commit dd213b5 into main Oct 16, 2023
10 checks passed
@patak-dev patak-dev deleted the mdx-is-js branch October 16, 2023 09:04
patak-dev pushed a commit that referenced this pull request Oct 17, 2023
Co-authored-by: Mark Dalgleish <mark.john.dalgleish@gmail.com>
patak-dev added a commit that referenced this pull request Oct 18, 2023
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
Co-authored-by: Mark Dalgleish <mark.john.dalgleish@gmail.com>
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