-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.mjs
50 lines (44 loc) · 1.18 KB
/
next.config.mjs
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
// Import the next-pwa plugin
import withPWA from "next-pwa";
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
swcMinify: true, // Enable SWC minification for improved performance
compiler: {
removeConsole: process.env.NODE_ENV !== "development", // Remove console.log in production
},
images: {
remotePatterns: [
{
protocol: 'https',
hostname: '**',
port: '',
pathname: '**',
},
],
},
headers
}
export async function headers() {
const headers = [];
if (process.env.NEXT_PUBLIC_VERCEL_ENV === 'preview') {
headers.push({
headers: [
{
key: 'X-Robots-Tag',
value: 'noindex',
},
],
source: '/:path*',
});
}
return headers;
}
const pwaConfig = {
dest: "public", // Destination directory for the PWA files
disable: process.env.NODE_ENV === "development", // Disable PWA in development mode
register: true, // Register the PWA service worker
skipWaiting: true, // Skip waiting for service worker activation
};
// Export the combined configuration for Next.js with PWA support
export default withPWA(pwaConfig)(nextConfig);