next-enterprise/next.config.mjs

32 lines
812 B
JavaScript
Raw Normal View History

import withBundleAnalyzer from "@next/bundle-analyzer"
import withPlugins from "next-compose-plugins"
2023-05-03 19:16:12 +02:00
import { env } from "./env.mjs"
2024-04-04 10:57:58 +00:00
import webpack from 'webpack';
2023-04-16 19:04:24 +02:00
2023-04-21 12:11:00 +02:00
/**
* @type {import('next').NextConfig}
*/
2023-05-03 19:16:12 +02:00
const config = withPlugins([[withBundleAnalyzer({ enabled: env.ANALYZE })]], {
2023-04-21 12:11:00 +02:00
reactStrictMode: true,
experimental: { instrumentationHook: true },
rewrites() {
return [
{ source: "/healthz", destination: "/api/health" },
{ source: "/api/healthz", destination: "/api/health" },
{ source: "/health", destination: "/api/health" },
{ source: "/ping", destination: "/api/health" },
]
},
2024-04-04 10:57:58 +00:00
webpack: (config, { isServer }) => {
config.module.rules.push({
test: /\.svg$/,
use: ["@svgr/webpack"]
});
return config
}
2023-04-21 12:11:00 +02:00
})
export default config