Unverified Commit bf3b84bd authored by Will Binns-Smith's avatar Will Binns-Smith Committed by GitHub

`@next/mdx`: Use stable turbopack config options (#78261)

parent 35e6080e
...@@ -23,6 +23,9 @@ module.exports = ...@@ -23,6 +23,9 @@ module.exports =
}, },
} }
/**
* @type {import('next').NextConfig}
*/
let nextConfig = Object.assign({}, inputConfig, { let nextConfig = Object.assign({}, inputConfig, {
webpack(config, options) { webpack(config, options) {
config.resolve.alias['next-mdx-import-source-file'] = [ config.resolve.alias['next-mdx-import-source-file'] = [
...@@ -44,22 +47,16 @@ module.exports = ...@@ -44,22 +47,16 @@ module.exports =
}) })
if (process.env.TURBOPACK) { if (process.env.TURBOPACK) {
nextConfig.experimental = Object.assign({}, nextConfig?.experimental, { nextConfig.turbopack = Object.assign({}, nextConfig?.turbopack, {
turbo: Object.assign({}, nextConfig?.experimental?.turbo, { rules: Object.assign({}, nextConfig?.turbopack?.rules, {
rules: Object.assign({}, nextConfig?.experimental?.turbo?.rules, {
'*.mdx': { '*.mdx': {
loaders: [loader], loaders: [loader],
as: '*.tsx', as: '*.tsx',
}, },
}), }),
resolveAlias: Object.assign( resolveAlias: Object.assign({}, nextConfig?.turbopack?.resolveAlias, {
{},
nextConfig?.experimental?.turbo?.resolveAlias,
{
'next-mdx-import-source-file': 'next-mdx-import-source-file':
'@vercel/turbopack-next/mdx-import-source', '@vercel/turbopack-next/mdx-import-source',
}
),
}), }),
}) })
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment