Files
xavierk 180cd4d512
CI / security (push) Successful in 1m14s
CI / lint (push) Successful in 24s
CI / ai-review (push) Skipped
fix(spec16): close the review findings for the Void port (#34)
Model recommendation keyed to the installed build and free memory, fork-sourced Void templates, signed xbps release workflow on Gitea with the pinned repository key, niri injection guard and wtype-first order, tightened naming sweep, web copy fixes, and CI security and duplication fixes.
2026-11-06 14:13:49 +00:00

75 lines
1.9 KiB
JavaScript

// @ts-ignore
/** @type {import("next").NextConfig} */
const config = {
output: 'export',
trailingSlash: true,
// Configuration for custom domain deployment
distDir: 'out',
// Cache/security headers live in public/_headers (copied into the static
// export). next.config headers() is ignored with output: 'export' and only
// produces build warnings.
images: {
unoptimized: true,
formats: ['image/avif', 'image/webp'],
remotePatterns: [
{
protocol: 'https',
hostname: '*',
pathname: '**',
},
],
},
eslint: {
ignoreDuringBuilds: true,
},
typescript: {
ignoreBuildErrors: true,
},
// Disable source maps in production to reduce bundle size
productionBrowserSourceMaps: false,
// Use modern JavaScript for better performance and smaller bundle sizes
experimental: {
optimizePackageImports: ['lucide-react', 'framer-motion'],
},
webpack: (config, { isServer, dev }) => {
// Only use source maps in development
if (!dev) {
config.devtool = false;
}
// Enhanced node polyfills for postgres and other modules
if (!isServer) {
config.resolve.fallback = {
...config.resolve.fallback,
// File system - never needed in browser
fs: false,
net: false,
tls: false,
crypto: false,
stream: false,
'perf_hooks': false,
// Definitely not needed in browser
child_process: false,
dns: false,
};
// Configure swc to output modern JavaScript (ES2022) instead of ES5
// This eliminates unnecessary polyfills and reduces bundle size
if (config.optimization && config.optimization.minimizer) {
config.optimization.minimizer.forEach((minimizer) => {
if (minimizer.constructor.name === 'TerserPlugin') {
minimizer.options.compress = {
...minimizer.options.compress,
pure_funcs: ['console.log', 'console.debug'],
};
}
});
}
}
return config;
},
};
export default config;