|
1 | | -import type { NextConfig } from "next"; |
2 | | -import createMDX from '@next/mdx'; |
3 | | -import remarkFrontmatter from 'remark-frontmatter'; |
4 | | -import remarkMdxFrontmatter from 'remark-mdx-frontmatter'; |
5 | | -import remarkGfm from 'remark-gfm'; |
6 | | -import bundleAnalyzer from '@next/bundle-analyzer'; |
7 | | -import createNextIntlPlugin from 'next-intl/plugin'; |
| 1 | +import bundleAnalyzer from '@next/bundle-analyzer' |
| 2 | +import createMDX from '@next/mdx' |
| 3 | +import type { NextConfig } from 'next' |
| 4 | +import createNextIntlPlugin from 'next-intl/plugin' |
| 5 | +import remarkFrontmatter from 'remark-frontmatter' |
| 6 | +import remarkGfm from 'remark-gfm' |
| 7 | +import remarkMdxFrontmatter from 'remark-mdx-frontmatter' |
8 | 8 |
|
9 | | -const withNextIntl = createNextIntlPlugin('./src/i18n/request.ts'); |
| 9 | +const withNextIntl = createNextIntlPlugin('./src/i18n/request.ts') |
10 | 10 |
|
11 | 11 | const withBundleAnalyzer = bundleAnalyzer({ |
12 | 12 | enabled: process.env.ANALYZE === 'true', |
13 | | -}); |
| 13 | +}) |
14 | 14 |
|
15 | 15 | // Security headers configuration |
16 | 16 | const securityHeaders = [ |
17 | 17 | { |
18 | 18 | key: 'X-DNS-Prefetch-Control', |
19 | | - value: 'on' |
| 19 | + value: 'on', |
20 | 20 | }, |
21 | 21 | { |
22 | 22 | key: 'X-Frame-Options', |
23 | | - value: 'SAMEORIGIN' |
| 23 | + value: 'SAMEORIGIN', |
24 | 24 | }, |
25 | 25 | { |
26 | 26 | key: 'X-Content-Type-Options', |
27 | | - value: 'nosniff' |
| 27 | + value: 'nosniff', |
28 | 28 | }, |
29 | 29 | { |
30 | 30 | key: 'Referrer-Policy', |
31 | | - value: 'strict-origin-when-cross-origin' |
| 31 | + value: 'strict-origin-when-cross-origin', |
32 | 32 | }, |
33 | 33 | { |
34 | 34 | key: 'Permissions-Policy', |
35 | | - value: 'camera=(), microphone=(), geolocation=()' |
| 35 | + value: 'camera=(), microphone=(), geolocation=()', |
36 | 36 | }, |
37 | | -]; |
| 37 | +] |
38 | 38 |
|
39 | 39 | const nextConfig: NextConfig = { |
40 | 40 | pageExtensions: ['js', 'jsx', 'md', 'mdx', 'ts', 'tsx'], |
@@ -67,26 +67,18 @@ const nextConfig: NextConfig = { |
67 | 67 |
|
68 | 68 | // Experimental features for better performance |
69 | 69 | experimental: { |
70 | | - optimizePackageImports: [ |
71 | | - 'lucide-react', |
72 | | - 'next-intl', |
73 | | - '@mdx-js/react', |
74 | | - 'gray-matter', |
75 | | - ], |
76 | | - // Turbopack configuration (Next.js 15+) |
77 | | - turbo: { |
78 | | - rules: { |
79 | | - // Add custom turbopack rules if needed |
80 | | - }, |
81 | | - }, |
| 70 | + optimizePackageImports: ['lucide-react', 'next-intl', '@mdx-js/react', 'gray-matter'], |
82 | 71 | }, |
83 | 72 |
|
84 | 73 | // Compiler optimizations |
85 | 74 | compiler: { |
86 | 75 | // Remove console logs in production (keep error and warn) |
87 | | - removeConsole: process.env.NODE_ENV === 'production' ? { |
88 | | - exclude: ['error', 'warn'] |
89 | | - } : false, |
| 76 | + removeConsole: |
| 77 | + process.env.NODE_ENV === 'production' |
| 78 | + ? { |
| 79 | + exclude: ['error', 'warn'], |
| 80 | + } |
| 81 | + : false, |
90 | 82 | }, |
91 | 83 |
|
92 | 84 | // TypeScript configuration |
@@ -149,20 +141,21 @@ const nextConfig: NextConfig = { |
149 | 141 | }, |
150 | 142 | ], |
151 | 143 | }, |
152 | | - ]; |
| 144 | + ] |
153 | 145 | }, |
154 | | -}; |
| 146 | +} |
155 | 147 |
|
156 | 148 | const withMDX = createMDX({ |
157 | 149 | extension: /\.mdx?$/, |
158 | 150 | options: { |
159 | 151 | remarkPlugins: [remarkFrontmatter, remarkMdxFrontmatter, remarkGfm], |
160 | 152 | rehypePlugins: [], |
161 | 153 | }, |
162 | | -}); |
| 154 | +}) |
163 | 155 |
|
164 | | -export default withNextIntl(withBundleAnalyzer(withMDX(nextConfig))); |
| 156 | +export default withNextIntl(withBundleAnalyzer(withMDX(nextConfig))) |
165 | 157 |
|
166 | 158 | // added by create cloudflare to enable calling `getCloudflareContext()` in `next dev` |
167 | | -import { initOpenNextCloudflareForDev } from '@opennextjs/cloudflare'; |
168 | | -initOpenNextCloudflareForDev(); |
| 159 | +import { initOpenNextCloudflareForDev } from '@opennextjs/cloudflare' |
| 160 | + |
| 161 | +initOpenNextCloudflareForDev() |
0 commit comments