2023-06-09 18:21:18 +10:00
|
|
|
|
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
|
|
|
|
const path = require('path');
|
2023-07-27 18:29:22 +10:00
|
|
|
|
const { withContentlayer } = require('next-contentlayer');
|
2023-06-09 18:21:18 +10:00
|
|
|
|
|
2023-10-18 23:19:29 +11:00
|
|
|
|
const ENV_FILES = ['.env', '.env.local', `.env.${process.env.NODE_ENV || 'development'}`];
|
|
|
|
|
|
|
|
|
|
|
|
ENV_FILES.forEach((file) => {
|
|
|
|
|
|
require('dotenv').config({
|
|
|
|
|
|
path: path.join(__dirname, `../../${file}`),
|
|
|
|
|
|
});
|
2023-06-09 18:21:18 +10:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
/** @type {import('next').NextConfig} */
|
|
|
|
|
|
const config = {
|
2023-09-14 12:46:36 +10:00
|
|
|
|
experimental: {
|
|
|
|
|
|
serverActions: true,
|
2023-09-20 13:48:30 +10:00
|
|
|
|
serverActionsBodySizeLimit: '10mb',
|
2023-09-14 12:46:36 +10:00
|
|
|
|
},
|
2023-06-09 18:21:18 +10:00
|
|
|
|
reactStrictMode: true,
|
|
|
|
|
|
transpilePackages: ['@documenso/lib', '@documenso/prisma', '@documenso/trpc', '@documenso/ui'],
|
2023-09-20 13:48:30 +10:00
|
|
|
|
env: {
|
|
|
|
|
|
NEXT_PUBLIC_PROJECT: 'marketing',
|
|
|
|
|
|
},
|
2023-09-14 12:46:36 +10:00
|
|
|
|
modularizeImports: {
|
|
|
|
|
|
'lucide-react': {
|
|
|
|
|
|
transform: 'lucide-react/dist/esm/icons/{{ kebabCase member }}',
|
|
|
|
|
|
},
|
|
|
|
|
|
},
|
2023-10-18 17:03:02 +05:30
|
|
|
|
webpack: (config, { isServer }) => {
|
|
|
|
|
|
// fixes: Module not found: Can’t resolve ‘../build/Release/canvas.node’
|
|
|
|
|
|
if (isServer) {
|
|
|
|
|
|
config.resolve.alias.canvas = false;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return config;
|
|
|
|
|
|
},
|
2023-09-18 20:13:46 -05:00
|
|
|
|
async headers() {
|
|
|
|
|
|
return [
|
|
|
|
|
|
{
|
|
|
|
|
|
source: '/:path*',
|
|
|
|
|
|
headers: [
|
|
|
|
|
|
{
|
|
|
|
|
|
key: 'x-dns-prefetch-control',
|
|
|
|
|
|
value: 'on',
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
key: 'strict-transport-security',
|
|
|
|
|
|
value: 'max-age=31536000; includeSubDomains; preload',
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
key: 'x-frame-options',
|
|
|
|
|
|
value: 'SAMEORIGIN',
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
key: 'x-content-type-options',
|
|
|
|
|
|
value: 'nosniff',
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
key: 'referrer-policy',
|
|
|
|
|
|
value: 'strict-origin-when-cross-origin',
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
key: 'permissions-policy',
|
|
|
|
|
|
value:
|
|
|
|
|
|
'accelerometer=(), camera=(), geolocation=(), gyroscope=(), magnetometer=(), microphone=(), payment=(), usb=()',
|
|
|
|
|
|
},
|
|
|
|
|
|
],
|
|
|
|
|
|
},
|
|
|
|
|
|
];
|
|
|
|
|
|
},
|
2023-09-28 12:56:53 +10:00
|
|
|
|
async rewrites() {
|
|
|
|
|
|
return [
|
|
|
|
|
|
{
|
|
|
|
|
|
source: '/ingest/:path*',
|
|
|
|
|
|
destination: 'https://eu.posthog.com/:path*',
|
|
|
|
|
|
},
|
|
|
|
|
|
];
|
|
|
|
|
|
},
|
2023-06-09 18:21:18 +10:00
|
|
|
|
};
|
|
|
|
|
|
|
2023-07-27 18:29:22 +10:00
|
|
|
|
module.exports = withContentlayer(config);
|