MCPcopy
hub / github.com/vercel/next.js / getOptions

Function getOptions

packages/next-mdx/mdx-js-loader.js:28–54  ·  view source on GitHub ↗
(options, projectRoot)

Source from the content-addressed store, hash-verified

26}
27
28async 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
56module.exports = function nextMdxLoader(...args) {
57 const options = this.getOptions()

Callers 1

mdx-js-loader.jsFile · 0.70

Calls 3

importPluginFunction · 0.85
allMethod · 0.80
mapMethod · 0.45

Tested by

no test coverage detected