⬆️(frontend) upgrade Next.js to v16

Upgrade Next.js to v16, which includes Turbopack
support by default. It improves dev and build
performance considerably.
This commit is contained in:
Anthony LC
2026-03-11 11:22:27 +01:00
parent 3cad1b8a39
commit 679b29e2e0
11 changed files with 92 additions and 70 deletions

View File

@@ -21,6 +21,17 @@ const nextConfig = {
env: {
NEXT_PUBLIC_BUILD_ID: buildId,
},
/**
* In dev mode, Next.js doesn't use Webpack, but Turbopack.
*/
turbopack: {
rules: {
'*.svg': {
loaders: ['@svgr/webpack'],
as: '*.js',
},
},
},
webpack(config, { isServer }) {
// Grab the existing rule that handles SVG imports
const fileLoaderRule = config.module.rules.find((rule) =>