docs(perf): optimizePackageImports is inert here - Turbopack makes it a no-op
Seven Mantine entry points were missing from optimizePackageImports while core/hooks/icons-react were listed. Added all seven, rebuilt, and the client bundle came out byte-for-byte identical: 482 files, 18050.7 KiB, same largest chunk, same chunk hashes. Identical output down to the hashes normally means a cached build, and turbopackFileSystemCacheForBuild is enabled here, so it got checked rather than written up as a null result. The Next.js docs are explicit: "This is not needed when using Turbopack. Turbopack automatically analyzes and optimizes imports without requiring this configuration." The build banner confirms Turbopack. So the change is reverted and the existing three-entry list documented as dead config, kept only as a webpack fallback. This also retires the sub-question of whether @homarr/ui - the largest barrel at 111 importers - could be optimised this way: it cannot, and it does not need to be. Two notes for anyone revisiting: Next 16 with Turbopack prints no size columns in its route table and emits no app-build-manifest.json, so per-route first-load JS is unavailable from build output; these numbers are total bytes under .next/static/chunks.
This commit is contained in:
4 files changed
+59
-13
No files matched your search
@@ -84,6 +84,15 @@ const nextConfig: NextConfig = {
|
||||
"@ioredis/commands",
|
||||
],
|
||||
experimental: {
|
||||
/**
|
||||
* Dead config under Turbopack, which this app builds with: "Turbopack automatically analyzes and
|
||||
* optimizes imports without requiring this configuration."
|
||||
*
|
||||
* Measured rather than assumed - adding the seven Mantine entry points that are missing here
|
||||
* (charts, dates, dropzone, form, notifications, spotlight, tiptap) produced a client bundle that
|
||||
* was byte-for-byte identical, 482 files and 18050.7 KiB in both arms, down to the chunk hashes.
|
||||
* Kept only as a fallback for a webpack build; do not add to it expecting an effect.
|
||||
*/
|
||||
optimizePackageImports: ["@mantine/core", "@mantine/hooks", "@tabler/icons-react"],
|
||||
turbopackFileSystemCacheForBuild: true,
|
||||
useTypeScriptCli: true,
|
||||
|
||||
Reference in new issue
Block a user