Download next.js/packages/next-mdx/index.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 2.14 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/packages/next-mdx/index.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/packages/next-mdx/index.js
-
curl -L -o index.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/packages/next-mdx/index.js
2.14 kB
| module.exports = | |
| (pluginOptions = {}) => | |
| (inputConfig = {}) => { | |
| const extension = pluginOptions.extension || /\.mdx$/ | |
| const userProvidedMdxOptions = pluginOptions.options | |
| const mdxRsOptions = inputConfig?.experimental?.mdxRs | |
| const loader = mdxRsOptions | |
| ? { | |
| loader: require.resolve('./mdx-rs-loader'), | |
| options: { | |
| providerImportSource: 'next-mdx-import-source-file', | |
| ...userProvidedMdxOptions, | |
| // mdxRsOptions is a union of boolean and object type of MdxTransformOptions | |
| ...(mdxRsOptions === true ? {} : mdxRsOptions), | |
| }, | |
| } | |
| : { | |
| loader: require.resolve('./mdx-js-loader'), | |
| options: { | |
| providerImportSource: 'next-mdx-import-source-file', | |
| ...userProvidedMdxOptions, | |
| }, | |
| } | |
| /** | |
| * @type {import('next').NextConfig} | |
| */ | |
| let nextConfig = Object.assign({}, inputConfig, { | |
| webpack(config, options) { | |
| config.resolve.alias['next-mdx-import-source-file'] = [ | |
| 'private-next-root-dir/src/mdx-components', | |
| 'private-next-root-dir/mdx-components', | |
| '@mdx-js/react', | |
| require.resolve('./mdx-components.js'), | |
| ] | |
| config.module.rules.push({ | |
| test: extension, | |
| use: [options.defaultLoaders.babel, loader], | |
| }) | |
| if (typeof inputConfig.webpack === 'function') { | |
| return inputConfig.webpack(config, options) | |
| } | |
| return config | |
| }, | |
| }) | |
| if (process.env.TURBOPACK) { | |
| nextConfig.turbopack = Object.assign({}, nextConfig?.turbopack, { | |
| rules: Object.assign({}, nextConfig?.turbopack?.rules, { | |
| '#next-mdx': { | |
| loaders: [loader], | |
| as: '*.tsx', | |
| }, | |
| }), | |
| conditions: { | |
| '#next-mdx': { | |
| path: extension, | |
| }, | |
| }, | |
| resolveAlias: Object.assign({}, nextConfig?.turbopack?.resolveAlias, { | |
| 'next-mdx-import-source-file': | |
| '@vercel/turbopack-next/mdx-import-source', | |
| }), | |
| }) | |
| } | |
| return nextConfig | |
| } | |