sharenet/frontend/next.config.ts
continuist c2d3897acf
All checks were successful
Podman Rootless Demo / test-backend (push) Has been skipped
Podman Rootless Demo / test-frontend (push) Successful in 12s
Podman Rootless Demo / build-backend (push) Successful in 19s
Podman Rootless Demo / build-frontend (push) Successful in 1m35s
Enable standalone output for Docker
2025-09-20 13:30:54 -04:00

65 lines
1.5 KiB
TypeScript

import type { NextConfig } from "next";
const nextConfig: NextConfig = {
// Performance optimizations
compress: true,
// Enable experimental features for better performance
experimental: {
// Enable optimized package imports
optimizePackageImports: ['lucide-react', '@radix-ui/react-dialog', '@radix-ui/react-label'],
},
// Turbopack configuration (moved from experimental)
turbopack: {
rules: {
'*.svg': {
loaders: ['@svgr/webpack'],
as: '*.js',
},
},
},
// Webpack optimizations
webpack: (config, { dev, isServer }) => {
// Optimize bundle size
if (!dev && !isServer) {
config.optimization = {
...config.optimization,
splitChunks: {
chunks: 'all',
cacheGroups: {
vendor: {
test: /[\\/]node_modules[\\/]/,
name: 'vendors',
chunks: 'all',
},
},
},
};
}
return config;
},
// Image optimization
images: {
formats: ['image/webp', 'image/avif'],
deviceSizes: [640, 750, 828, 1080, 1200, 1920, 2048, 3840],
imageSizes: [16, 32, 48, 64, 96, 128, 256, 384],
},
// Enable static optimization
trailingSlash: false,
poweredByHeader: false,
// Enable standalone output for Docker
output: 'standalone',
// Compiler optimizations
compiler: {
removeConsole: process.env.NODE_ENV === 'production',
},
};
export default nextConfig;