32 lines
924 B
TypeScript
32 lines
924 B
TypeScript
import type { NextConfig } from "next";
|
|
import { getSecurityHeaders } from "./src/lib/security/headers";
|
|
|
|
const nextConfig: NextConfig = {
|
|
distDir: process.env.MAILFLARE_RUNTIME === "node" ? ".next-node" : undefined,
|
|
turbopack: {
|
|
root: import.meta.dirname,
|
|
resolveAlias: process.env.MAILFLARE_RUNTIME === "node" ? {
|
|
"cloudflare:workers": "./server/runtime/cloudflare-workers.ts",
|
|
} : {},
|
|
},
|
|
allowedDevOrigins: ['mail.dev'],
|
|
typescript: {
|
|
// !! WARN !!
|
|
// Dangerously allow production builds to successfully complete
|
|
// even if your project has type errors.
|
|
ignoreBuildErrors: true,
|
|
},
|
|
// Native and server-only packages used by the self-hosted runtime; never bundle them.
|
|
serverExternalPackages: ["better-sqlite3", "nodemailer", "smtp-server", "ws"],
|
|
async headers() {
|
|
return [
|
|
{
|
|
source: "/(.*)",
|
|
headers: getSecurityHeaders(),
|
|
},
|
|
];
|
|
},
|
|
};
|
|
|
|
export default nextConfig;
|