@next/mdx 15.4.2-canary.7 → 15.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +1 -16
- package/mdx-js-loader.js +7 -14
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -21,22 +21,7 @@ declare namespace nextMDX {
|
|
|
21
21
|
*
|
|
22
22
|
* @see https://mdxjs.com/packages/mdx/#api
|
|
23
23
|
*/
|
|
24
|
-
options?: Options
|
|
25
|
-
remarkPlugins?:
|
|
26
|
-
| (
|
|
27
|
-
| string
|
|
28
|
-
| [name: string, options: any]
|
|
29
|
-
| NonNullable<Options['remarkPlugins']>[number]
|
|
30
|
-
)[]
|
|
31
|
-
| Options['remarkPlugins']
|
|
32
|
-
rehypePlugins?:
|
|
33
|
-
| (
|
|
34
|
-
| string
|
|
35
|
-
| [name: string, options: any]
|
|
36
|
-
| NonNullable<Options['rehypePlugins']>[number]
|
|
37
|
-
)[]
|
|
38
|
-
| Options['rehypePlugins']
|
|
39
|
-
}
|
|
24
|
+
options?: Options
|
|
40
25
|
}
|
|
41
26
|
}
|
|
42
27
|
|
package/mdx-js-loader.js
CHANGED
|
@@ -5,22 +5,15 @@ function interopDefault(mod) {
|
|
|
5
5
|
return mod.default || mod
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
async function importPluginForPath(pluginPath, projectRoot) {
|
|
9
|
-
const path = require.resolve(pluginPath, { paths: [projectRoot] })
|
|
10
|
-
return interopDefault(
|
|
11
|
-
// "use pathToFileUrl to make esm import()s work with absolute windows paths":
|
|
12
|
-
// on windows import("C:\\path\\to\\file") is not valid, so we need to use file:// URLs
|
|
13
|
-
// https://github.com/vercel/next.js/commit/fbf9e12de095e0237d4ba4aa6139d9757bd20be9
|
|
14
|
-
await import(process.platform === 'win32' ? pathToFileURL(path) : path)
|
|
15
|
-
)
|
|
16
|
-
}
|
|
17
|
-
|
|
18
8
|
async function importPlugin(plugin, projectRoot) {
|
|
19
9
|
if (Array.isArray(plugin) && typeof plugin[0] === 'string') {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
10
|
+
const path = require.resolve(plugin[0], { paths: [projectRoot] })
|
|
11
|
+
plugin[0] = interopDefault(
|
|
12
|
+
// "use pathToFileUrl to make esm import()s work with absolute windows paths":
|
|
13
|
+
// on windows import("C:\\path\\to\\file") is not valid, so we need to use file:// URLs
|
|
14
|
+
// https://github.com/vercel/next.js/commit/fbf9e12de095e0237d4ba4aa6139d9757bd20be9
|
|
15
|
+
await import(process.platform === 'win32' ? pathToFileURL(path) : path)
|
|
16
|
+
)
|
|
24
17
|
}
|
|
25
18
|
return plugin
|
|
26
19
|
}
|