mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
This has been causing a lot of confusion when contributors have been debugging tree shaking, eg. https://github.com/vercel/next.js/issues/95698 and the linked issues. Turbopack's standard tree-shaking features are controlled through the `turbopackRemoveUnusedExports` and `turbopackRemoveUnusedImports` options which default to true.
25 lines
490 B
JavaScript
25 lines
490 B
JavaScript
// Next.js config with wrapper function
|
|
const nextConfig = {
|
|
experimental: {
|
|
typedRoutes: true,
|
|
turbopackMinify: true,
|
|
turbopackModuleFragments: false,
|
|
turbopackSourceMaps: true
|
|
},
|
|
|
|
images: {
|
|
formats: ['image/avif', 'image/webp'],
|
|
},
|
|
|
|
turbopack: {
|
|
resolveAlias: {
|
|
underscore: 'lodash',
|
|
mocha: { browser: 'mocha/browser-entry.js' },
|
|
}
|
|
}
|
|
};
|
|
|
|
// Wrapper function
|
|
const withMDX = require("@next/mdx")();
|
|
module.exports = withMDX(nextConfig);
|