@@ -342,7 +342,7 @@ import * as runtime from 'react/jsx-runtime'
342342
343343const code = ' ' // To do: get `code` from server somehow.
344344
345- const {default : Content} = await run (code , runtime )
345+ const {default : Content} = await run (code , { ... runtime , baseUrl: import . meta . url } )
346346
347347console .log (Content )
348348```
@@ -569,7 +569,7 @@ Configuration for `createProcessor` (TypeScript type).
569569
570570 const path = ' example.mdx'
571571 const value = await fs .readFile (path )
572- const MDXContent = (await evaluate ({path , value }, runtime )).default
572+ const MDXContent = (await evaluate ({path , value }, { ... runtime , baseUrl: import . meta . url } )).default
573573
574574 console .log (MDXContent ({}))
575575 ```
@@ -595,8 +595,8 @@ Configuration for `createProcessor` (TypeScript type).
595595
596596 const path = 'example.mdx'
597597 const value = await fs.readFile(path)
598- -const MDXContent = (await evaluate({path, value}, runtime)).default
599- +const MDXContent = (await evaluate({path, value}, {development: true, ...runtime})).default
598+ -const MDXContent = (await evaluate({path, value}, {... runtime, baseUrl: import.meta.url} )).default
599+ +const MDXContent = (await evaluate({path, value}, {development: true, ...runtime, baseUrl: import.meta.url })).default
600600
601601 console.log(MDXContent({}))
602602 ```
@@ -1021,7 +1021,7 @@ matter).
10211021* ` jsxs ` ([ ` Jsx ` ] [ api-jsx ] , optional)
10221022 — function to generate an element with dynamic children in production mode
10231023* ` useMDXComponents ` ([ ` UseMdxComponents ` ] [ api-use-mdx-components ] , optional)
1024- — function to get components from context
1024+ — function to get components to use
10251025
10261026###### Examples
10271027
@@ -1030,7 +1030,7 @@ A `/jsx-runtime` module will expose `Fragment`, `jsx`, and `jsxs`:
10301030``` tsx
10311031import * as runtime from ' react/jsx-runtime'
10321032
1033- const {default : Content} = await evaluate (' # hi' , {... runtime , ... otherOptions })
1033+ const {default : Content} = await evaluate (' # hi' , {... runtime , baseUrl: import . meta . url , ... otherOptions })
10341034
10351035```
10361036
@@ -1039,7 +1039,7 @@ A `/jsx-dev-runtime` module will expose `Fragment` and `jsxDEV`:
10391039``` tsx
10401040import * as runtime from ' react/jsx-dev-runtime'
10411041
1042- const {default : Content} = await evaluate (' # hi' , {development: true , ... runtime , ... otherOptions })
1042+ const {default : Content} = await evaluate (' # hi' , {development: true , baseUrl: import . meta . url , ... runtime , ... otherOptions })
10431043```
10441044
10451045Our providers will expose ` useMDXComponents ` :
@@ -1048,12 +1048,12 @@ Our providers will expose `useMDXComponents`:
10481048import * as provider from ' @mdx-js/react'
10491049import * as runtime from ' react/jsx-runtime'
10501050
1051- const {default : Content} = await evaluate (' # hi' , {... provider , ... runtime , ... otherOptions })
1051+ const {default : Content} = await evaluate (' # hi' , {... provider , ... runtime , baseUrl: import . meta . url , ... otherOptions })
10521052```
10531053
10541054### ` UseMdxComponents `
10551055
1056- Get components from context (TypeScript type).
1056+ Get components (TypeScript type).
10571057
10581058###### Parameters
10591059
0 commit comments