Skip to content

Commit d0b2f8a

Browse files
ijjkwbinnssmith
andauthored
@next/mdx: Use stable turbopack config options (#78880)
Backport of #78261 to 15.3.x Co-authored-by: Will Binns-Smith <[email protected]>
1 parent 04176de commit d0b2f8a

File tree

1 file changed

+13
-16
lines changed

1 file changed

+13
-16
lines changed

packages/next-mdx/index.js

+13-16
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ module.exports =
2323
},
2424
}
2525

26+
/**
27+
* @type {import('next').NextConfig}
28+
*/
2629
let nextConfig = Object.assign({}, inputConfig, {
2730
webpack(config, options) {
2831
config.resolve.alias['next-mdx-import-source-file'] = [
@@ -44,22 +47,16 @@ module.exports =
4447
})
4548

4649
if (process.env.TURBOPACK) {
47-
nextConfig.experimental = Object.assign({}, nextConfig?.experimental, {
48-
turbo: Object.assign({}, nextConfig?.experimental?.turbo, {
49-
rules: Object.assign({}, nextConfig?.experimental?.turbo?.rules, {
50-
'*.mdx': {
51-
loaders: [loader],
52-
as: '*.tsx',
53-
},
54-
}),
55-
resolveAlias: Object.assign(
56-
{},
57-
nextConfig?.experimental?.turbo?.resolveAlias,
58-
{
59-
'next-mdx-import-source-file':
60-
'@vercel/turbopack-next/mdx-import-source',
61-
}
62-
),
50+
nextConfig.turbopack = Object.assign({}, nextConfig?.turbopack, {
51+
rules: Object.assign({}, nextConfig?.turbopack?.rules, {
52+
'*.mdx': {
53+
loaders: [loader],
54+
as: '*.tsx',
55+
},
56+
}),
57+
resolveAlias: Object.assign({}, nextConfig?.turbopack?.resolveAlias, {
58+
'next-mdx-import-source-file':
59+
'@vercel/turbopack-next/mdx-import-source',
6360
}),
6461
})
6562
}

0 commit comments

Comments
 (0)