Unverified Commit d0b2f8a8 authored by JJ Kasper's avatar JJ Kasper Committed by GitHub

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

Backport of #78261 to 15.3.x
Co-authored-by: 's avatarWill Binns-Smith <wbinnssmith@gmail.com>
parent 04176dec
...@@ -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