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 = {
|
2022-04-10 23:05:42 -04:00
|
|
|
reactStrictMode: true,
|
|
|
|
experimental: {
|
2022-11-08 03:28:19 -05:00
|
|
|
// outputStandalone: true,
|
|
|
|
esmExternals: true,
|
|
|
|
// appDir: true
|
2022-04-10 23:05:42 -04:00
|
|
|
},
|
|
|
|
webpack: (config, { dev, isServer }) => {
|
|
|
|
if (!dev && !isServer) {
|
|
|
|
// TODO: enabling Preact causes the file switcher to hang the browser process
|
|
|
|
// Object.assign(config.resolve.alias, {
|
|
|
|
// react: "preact/compat",
|
|
|
|
// "react-dom/test-utils": "preact/test-utils",
|
|
|
|
// "react-dom": "preact/compat"
|
|
|
|
// })
|
|
|
|
}
|
|
|
|
return config
|
|
|
|
},
|
|
|
|
async rewrites() {
|
|
|
|
return [
|
|
|
|
{
|
|
|
|
source: "/server-api/:path*",
|
|
|
|
destination: `${process.env.API_URL}/:path*`
|
|
|
|
},
|
|
|
|
{
|
|
|
|
source: "/file/raw/:id",
|
|
|
|
destination: `/api/raw/:id`
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
2022-03-23 18:34:23 -04:00
|
|
|
}
|
2022-03-06 19:46:59 -05:00
|
|
|
|
2022-03-21 23:30:45 -04:00
|
|
|
export default bundleAnalyzer({ enabled: process.env.ANALYZE === "true" })(
|
2022-04-10 23:05:42 -04:00
|
|
|
nextConfig
|
2022-03-23 18:34:23 -04:00
|
|
|
)
|