Skip to content

Commit

Permalink
Add note about use with vite-plugin-react
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Dec 8, 2022
1 parent 1c83612 commit 4a1415d
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions docs/docs/getting-started.server.mdx
Expand Up @@ -358,6 +358,22 @@ If you use more modern JavaScript features than what your users support,
Make sure `rollup@3` is not installed.
</Note>

<Note type="info">
**Note**: If you also use `vitejs/vite-plugin-react`, you need to force
`@mdx-js/rollup` to run in the `pre` phase before it:

```js path="vite.config.js"
//
export default defineConfig({
plugins: [
{enforce: 'pre', ...mdx(/* jsxImportSource: …, otherOptions… */)},
react()
]
})
//
```
</Note>

See also [¶ Rollup][rollup], which is used in Vite, and see [¶ Vue][vue], if
you’re using that, for more info.

Expand Down

1 comment on commit 4a1415d

@vercel
Copy link

@vercel vercel bot commented on 4a1415d Dec 8, 2022

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

mdx – ./

mdx-mdx.vercel.app
v2.mdxjs.com
mdx-git-main-mdx.vercel.app
mdxjs.com

Please sign in to comment.