CoastalCommitsPastes/client/next.config.mjs

39 lines
834 B
JavaScript
Raw Normal View History

2022-03-23 18:34:23 -04:00
import bundleAnalyzer from "@next/bundle-analyzer"
2022-03-08 02:09:30 -05:00
2022-03-06 19:46:59 -05:00
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
experimental: {
// outputStandalone: true,
2022-11-09 01:14:43 -05:00
// esmExternals: true,
appDir: true
},
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: "/file/raw/:id",
destination: `/api/raw/:id`
2022-11-12 21:39:03 -05:00
},
{
source: "/home",
destination: "/",
}
]
}
2022-03-23 18:34:23 -04:00
}
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
)