* chore: upgrade next.js * fix: canvas not found error * chore: upgrade package for marketing * feat: add isServer conditional * fix: inverse isServer condition * fix: normalize packages * fix: upgrade ee package * fix: depdency nightmares * fix: failing seed script
77 lines
1.6 KiB
JavaScript
77 lines
1.6 KiB
JavaScript
/* eslint-disable @typescript-eslint/no-var-requires */
|
||
const path = require('path');
|
||
const { version } = require('./package.json');
|
||
|
||
require('dotenv').config({
|
||
path: path.join(__dirname, '../../.env.local'),
|
||
});
|
||
|
||
/** @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 }}',
|
||
},
|
||
},
|
||
webpack: (config, { isServer }) => {
|
||
// fixes: Module not found: Can’t resolve ‘../build/Release/canvas.node’
|
||
if (isServer) {
|
||
config.resolve.alias.canvas = false;
|
||
}
|
||
|
||
return config;
|
||
},
|
||
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;
|