CoastalCommitsPastes/client/next.config.mjs

40 lines
866 B
JavaScript
Raw Permalink Normal View History

2022-03-23 18:34:23 -04:00
import dotenv from "dotenv"
import bundleAnalyzer from "@next/bundle-analyzer"
2022-03-08 02:09:30 -05:00
2022-03-23 18:34:23 -04:00
dotenv.config()
2022-03-21 18:55:21 -04:00
2022-03-06 19:46:59 -05:00
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
2022-03-07 23:42:44 -05:00
experimental: {
outputStandalone: true,
2022-03-23 18:34:23 -04:00
esmExternals: true
},
webpack: (config, { dev, isServer }) => {
if (!dev && !isServer) {
Object.assign(config.resolve.alias, {
react: "preact/compat",
"react-dom/test-utils": "preact/test-utils",
"react-dom": "preact/compat"
})
}
return config
2022-03-07 23:42:44 -05:00
},
2022-03-06 19:46:59 -05:00
async rewrites() {
return [
{
source: "/server-api/:path*",
2022-03-23 18:34:23 -04:00
destination: `${process.env.API_URL}/:path*`
2022-03-06 19:46:59 -05:00
},
{
source: "/file/raw/:id",
2022-03-23 18:34:23 -04:00
destination: `/api/raw/:id`
}
]
}
}
2022-03-06 19:46:59 -05:00
export default bundleAnalyzer({ enabled: process.env.ANALYZE === "true" })(
nextConfig
2022-03-23 18:34:23 -04:00
)