2023-02-22 11:23:04 +00:00
|
|
|
/** @type {import('next').NextConfig} */
|
|
|
|
module.exports = {
|
2023-04-14 15:40:49 +00:00
|
|
|
transpilePackages: ["@saleor/apps-shared"],
|
2023-02-22 11:23:04 +00:00
|
|
|
reactStrictMode: true,
|
|
|
|
rewrites() {
|
|
|
|
/**
|
|
|
|
* For dev/preview Next.js can work as a proxy and redirect unknown paths to provided backend address
|
|
|
|
*
|
|
|
|
* In production, when env is not provided, frontend will call its relative path and reverse proxy will do the rest
|
|
|
|
*/
|
|
|
|
const backendPath = process.env.MONITORING_APP_API_URL ?? "";
|
|
|
|
|
|
|
|
return {
|
|
|
|
fallback: [
|
|
|
|
{
|
|
|
|
source: "/:path*",
|
|
|
|
destination: `${backendPath}/:path*`,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
};
|
|
|
|
},
|
|
|
|
};
|