feat: resolve mdx imports relative to components dir
This commit is contained in:
@ -69,6 +69,8 @@ export async function getFileBySlug(type, slug) {
|
||||
}
|
||||
|
||||
const { code } = await bundleMDX(source, {
|
||||
// mdx imports can be automatically source from the components directory
|
||||
cwd: path.join(process.cwd(), 'components'),
|
||||
xdmOptions(options) {
|
||||
// this is the recommended way to add custom remark/rehype plugins:
|
||||
// The syntax might look weird, but it protects you in case we add/remove
|
||||
@ -100,6 +102,13 @@ export async function getFileBySlug(type, slug) {
|
||||
]
|
||||
return options
|
||||
},
|
||||
esbuildOptions: (options) => {
|
||||
options.loader = {
|
||||
...options.loader,
|
||||
'.js': 'jsx',
|
||||
}
|
||||
return options
|
||||
},
|
||||
})
|
||||
|
||||
return {
|
||||
|
Reference in New Issue
Block a user