support esm modules

This commit is contained in:
MichalTarasiuk 2024-03-08 19:36:06 +01:00
parent 765cc0c7cf
commit dcbdb0ccb7
11 changed files with 43 additions and 38 deletions

21
next.config.js Normal file
View file

@ -0,0 +1,21 @@
import withBundleAnalyzer from "@next/bundle-analyzer"
import withPlugins from "next-compose-plugins"
import { env } from "./env.js"
/**
* @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" },
]
},
})
export default config