mirror of
https://github.com/formbricks/formbricks.git
synced 2026-01-18 04:19:53 -06:00
74 lines
1.9 KiB
JavaScript
74 lines
1.9 KiB
JavaScript
/**
|
|
* @type {import('next').NextConfig}
|
|
*/
|
|
|
|
var path = require("path");
|
|
const { withSentryConfig } = require("@sentry/nextjs");
|
|
|
|
const withTM = require("next-transpile-modules")(["@formbricks/ee"]);
|
|
|
|
const nextConfig = {
|
|
reactStrictMode: true,
|
|
output: "standalone",
|
|
experimental: {
|
|
outputFileTracingRoot: path.join(__dirname, "../../"),
|
|
/* serverComponentsExternalPackages: ["@prisma/client"], */
|
|
},
|
|
images: {
|
|
remotePatterns: [
|
|
{
|
|
protocol: "https",
|
|
hostname: "avatars.githubusercontent.com",
|
|
},
|
|
],
|
|
},
|
|
webpack: (config) => {
|
|
config.externals = [...(config.externals || []), "@prisma/client"];
|
|
// Important: return the modified config
|
|
return config;
|
|
},
|
|
async headers() {
|
|
return [
|
|
{
|
|
// matching all API routes
|
|
source: "/api/:path*",
|
|
headers: [
|
|
{ key: "Access-Control-Allow-Credentials", value: "true" },
|
|
{ key: "Access-Control-Allow-Origin", value: "*" },
|
|
{ key: "Access-Control-Allow-Methods", value: "GET,OPTIONS,PATCH,DELETE,POST,PUT" },
|
|
{
|
|
key: "Access-Control-Allow-Headers",
|
|
value:
|
|
"X-CSRF-Token, X-Requested-With, Accept, Accept-Version, Content-Length, Content-MD5, Content-Type, Date, X-Api-Version",
|
|
},
|
|
],
|
|
},
|
|
];
|
|
},
|
|
async redirects() {
|
|
return [
|
|
{
|
|
source: "/demo",
|
|
destination: "/demo/organisations/demo-organisation/forms/demo-pmf",
|
|
permanent: false,
|
|
},
|
|
];
|
|
},
|
|
};
|
|
|
|
if (process.env.NEXT_PUBLIC_SENTRY_DSN) {
|
|
nextConfig.sentry = {
|
|
hideSourceMaps: true,
|
|
};
|
|
}
|
|
|
|
const sentryWebpackPluginOptions = {
|
|
silent: true, // Suppresses all logs
|
|
};
|
|
|
|
const moduleExports = () => [withTM].reduce((acc, next) => next(acc), nextConfig);
|
|
|
|
module.exports = process.env.NEXT_PUBLIC_SENTRY_DSN
|
|
? withSentryConfig(moduleExports, sentryWebpackPluginOptions)
|
|
: moduleExports;
|