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 =
},
}
/**
* @type {import('next').NextConfig}
*/
let nextConfig = Object.assign({}, inputConfig, {
webpack(config, options) {
config.resolve.alias['next-mdx-import-source-file'] = [
......@@ -44,22 +47,16 @@ module.exports =
})
if (process.env.TURBOPACK) {
nextConfig.experimental = Object.assign({}, nextConfig?.experimental, {
turbo: Object.assign({}, nextConfig?.experimental?.turbo, {
rules: Object.assign({}, nextConfig?.experimental?.turbo?.rules, {
'*.mdx': {
loaders: [loader],
as: '*.tsx',
},
}),
resolveAlias: Object.assign(
{},
nextConfig?.experimental?.turbo?.resolveAlias,
{
'next-mdx-import-source-file':
'@vercel/turbopack-next/mdx-import-source',
}
),
nextConfig.turbopack = Object.assign({}, nextConfig?.turbopack, {
rules: Object.assign({}, nextConfig?.turbopack?.rules, {
'*.mdx': {
loaders: [loader],
as: '*.tsx',
},
}),
resolveAlias: Object.assign({}, nextConfig?.turbopack?.resolveAlias, {
'next-mdx-import-source-file':
'@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