next-enterprise/next.config.mjs
2024-04-04 10:57:58 +00:00

31 lines
812 B
JavaScript

import withBundleAnalyzer from "@next/bundle-analyzer"
import withPlugins from "next-compose-plugins"
import { env } from "./env.mjs"
import webpack from 'webpack';
/**
* @type {import('next').NextConfig}
*/
const config = withPlugins([[withBundleAnalyzer({ enabled: env.ANALYZE })]], {
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" },
]
},
webpack: (config, { isServer }) => {
config.module.rules.push({
test: /\.svg$/,
use: ["@svgr/webpack"]
});
return config
}
})
export default config