mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 16:23:06 +10:00
73 lines
1.5 KiB
JavaScript
73 lines
1.5 KiB
JavaScript
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
const path = require('path');
|
|
const { version } = require('./package.json');
|
|
|
|
const ENV_FILES = ['.env', '.env.local', `.env.${process.env.NODE_ENV || 'development'}`];
|
|
|
|
ENV_FILES.forEach((file) => {
|
|
require('dotenv').config({
|
|
path: path.join(__dirname, `../../${file}`),
|
|
});
|
|
});
|
|
|
|
/** @type {import('next').NextConfig} */
|
|
const config = {
|
|
experimental: {
|
|
serverActions: true,
|
|
serverActionsBodySizeLimit: '50mb',
|
|
},
|
|
reactStrictMode: true,
|
|
transpilePackages: [
|
|
'@documenso/lib',
|
|
'@documenso/prisma',
|
|
'@documenso/trpc',
|
|
'@documenso/ui',
|
|
'@documenso/email',
|
|
],
|
|
env: {
|
|
APP_VERSION: version,
|
|
NEXT_PUBLIC_PROJECT: 'web',
|
|
},
|
|
modularizeImports: {
|
|
'lucide-react': {
|
|
transform: 'lucide-react/dist/esm/icons/{{ kebabCase member }}',
|
|
},
|
|
},
|
|
async rewrites() {
|
|
return [
|
|
{
|
|
source: '/ingest/:path*',
|
|
destination: 'https://eu.posthog.com/:path*',
|
|
},
|
|
];
|
|
},
|
|
async redirects() {
|
|
return [
|
|
{
|
|
permanent: true,
|
|
source: '/documents/:id/sign',
|
|
destination: '/sign/:token',
|
|
has: [
|
|
{
|
|
type: 'query',
|
|
key: 'token',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
permanent: true,
|
|
source: '/documents/:id/signed',
|
|
destination: '/sign/:token',
|
|
has: [
|
|
{
|
|
type: 'query',
|
|
key: 'token',
|
|
},
|
|
],
|
|
},
|
|
];
|
|
},
|
|
};
|
|
|
|
module.exports = config;
|