(options, projectRoot)
| 26 | } |
| 27 | |
| 28 | async function getOptions(options, projectRoot) { |
| 29 | const { |
| 30 | recmaPlugins = [], |
| 31 | rehypePlugins = [], |
| 32 | remarkPlugins = [], |
| 33 | ...rest |
| 34 | } = options |
| 35 | |
| 36 | const [updatedRecma, updatedRehype, updatedRemark] = await Promise.all([ |
| 37 | Promise.all( |
| 38 | recmaPlugins.map((plugin) => importPlugin(plugin, projectRoot)) |
| 39 | ), |
| 40 | Promise.all( |
| 41 | rehypePlugins.map((plugin) => importPlugin(plugin, projectRoot)) |
| 42 | ), |
| 43 | Promise.all( |
| 44 | remarkPlugins.map((plugin) => importPlugin(plugin, projectRoot)) |
| 45 | ), |
| 46 | ]) |
| 47 | |
| 48 | return { |
| 49 | ...rest, |
| 50 | recmaPlugins: updatedRecma, |
| 51 | rehypePlugins: updatedRehype, |
| 52 | remarkPlugins: updatedRemark, |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | module.exports = function nextMdxLoader(...args) { |
| 57 | const options = this.getOptions() |
no test coverage detected