-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.ts
53 lines (51 loc) · 1.9 KB
/
next.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import type { NextConfig } from "next";
const nextConfig: NextConfig = {
reactStrictMode: true, // Recommended for development to catch potential issues early. Set to false in production if needed for performance.
compiler: {
// Enable styled-components if you use it. Removes runtime CSS-in-JS overhead.
styledComponents: true, // Or: { displayName: true, ssr: true } for more control
// Remove react-refresh in production builds
removeConsole: process.env.NODE_ENV === 'production',
},
// Optional optimizations - enable as needed and test thoroughly
// image: {
// formats: ['image/avif', 'image/webp'], // Serve modern image formats
// remotePatterns: [ // Optimize images from external sources
// {
// protocol: 'https',
// hostname: '**.example.com', // Replace with your hostname(s)
// port: '',
// pathname: '/images/**',
// },
// ],
// },
// If you use a specific locale:
// i18n: {
// locales: ['en', 'es', 'fr'],
// defaultLocale: 'en',
// },
// For static site generation (SSG) or static export:
// output: 'export', // or 'standalone' for a single deployable output
// Optional: Analyze the bundle size to identify areas for optimization
// webpack: (config, { buildId, dev, isServer, defaultLoaders, webpack }) => {
// if (!dev) {
// config.optimization.minimize = true;
// config.optimization.minimizer = [
// new TerserWebpackPlugin({ // Or use SWC minifier if you prefer
// terserOptions: {
// compress: {
// drop_console: true, // Remove console.log in production
// },
// },
// }),
// ];
// }
// return config;
// },
// Optional: If you have very specific needs, you can customize the Babel configuration:
// babel: {
// presets: ['next/babel'],
// plugins: [],
// },
};
export default nextConfig;