-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.js
More file actions
21 lines (18 loc) · 834 Bytes
/
Copy pathnext.config.js
File metadata and controls
21 lines (18 loc) · 834 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/** @type {import('next').NextConfig} */
// Configuration options for Next.js
const nextConfig = {
reactStrictMode: true, // Enable React strict mode for improved error handling
swcMinify: true, // Enable SWC minification for improved performance
compiler: {
removeConsole: process.env.NODE_ENV !== 'development', // Remove console.log in production
},
};
// Configuration object tells the next-pwa plugin
const withPWA = require('next-pwa')({
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
module.exports = withPWA(nextConfig);