commerce/next.config.js
2023-08-11 23:37:34 +02:00

41 lines
961 B
JavaScript

/** @type {import('next').NextConfig} */
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.BUNDLE_ANALYZE === 'true',
})
module.exports = withBundleAnalyzer(
{
async rewrites() {
return [
{
source: '/en/product/:slug',
destination: '/en/produkt/:slug',
locale: false
},
{
source: '/en/category/:slug',
destination: '/en/kategori/:slug',
locale: false
},
{
source: '/en/search',
destination: '/en/sok',
locale: false
},
]
},
eslint: {
// Disabling on production builds because we're running checks on PRs via GitHub Actions.
ignoreDuringBuilds: true
},
experimental: {
scrollRestoration: true,
serverActions: true,
},
images: {
formats: ['image/avif', 'image/webp'],
domains: ['cdn.sanity.io'],
},
}
);