2022-03-21 20:30:45 -07:00
|
|
|
import dotenv from "dotenv";
|
|
|
|
import bundleAnalyzer from "@next/bundle-analyzer";
|
2022-03-07 23:09:30 -08:00
|
|
|
|
2022-03-21 20:30:45 -07:00
|
|
|
dotenv.config();
|
2022-03-21 15:55:21 -07:00
|
|
|
|
2022-03-06 16:46:59 -08:00
|
|
|
/** @type {import('next').NextConfig} */
|
|
|
|
const nextConfig = {
|
|
|
|
reactStrictMode: true,
|
2022-03-07 20:42:44 -08:00
|
|
|
experimental: {
|
|
|
|
outputStandalone: true,
|
2022-03-21 20:30:45 -07:00
|
|
|
esmExternals: true,
|
2022-03-07 20:42:44 -08:00
|
|
|
},
|
2022-03-06 16:46:59 -08:00
|
|
|
async rewrites() {
|
|
|
|
return [
|
|
|
|
{
|
2022-03-11 18:48:40 -08:00
|
|
|
source: "/server-api/:path*",
|
2022-03-07 23:09:30 -08:00
|
|
|
destination: `${process.env.API_URL}/:path*`,
|
2022-03-06 16:46:59 -08:00
|
|
|
},
|
2022-03-11 18:48:40 -08:00
|
|
|
{
|
|
|
|
source: "/file/raw/:id",
|
|
|
|
destination: `/api/raw/:id`,
|
|
|
|
},
|
2022-03-06 16:46:59 -08:00
|
|
|
];
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2022-03-21 20:30:45 -07:00
|
|
|
export default bundleAnalyzer({ enabled: process.env.ANALYZE === "true" })(
|
|
|
|
nextConfig
|
|
|
|
);
|