-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnext.config.ts
More file actions
32 lines (29 loc) · 829 Bytes
/
Copy pathnext.config.ts
File metadata and controls
32 lines (29 loc) · 829 Bytes
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
import type { NextConfig } from 'next';
import withSerwistInit from '@serwist/next';
const withSerwist = withSerwistInit({
swSrc: 'src/app/sw.ts',
swDest: 'public/sw.js',
disable: process.env.NODE_ENV !== "production",
});
const nextConfig: NextConfig = {
output: 'export',
images: {
unoptimized: true,
},
// Fix Turbopack compat error with next-pwa/serwist webpack config
turbopack: {},
// Trailing slash for hosting compatibility
trailingSlash: true,
// Performance: compress responses
compress: true,
// Security: remove X-Powered-By header
poweredByHeader: false,
// Security headers for all routes (now managed by _headers on Cloudflare Pages/Static hosting)
// Structured logging
logging: {
fetches: {
fullUrl: true,
},
},
};
export default withSerwist(nextConfig);