/ frontend / next.config.js
next.config.js
 1  /** @type {import('next').NextConfig} */
 2  const nextConfig = {
 3      env: {
 4          GOOGLE_MAPS_ACCESS_TOKEN: process.env.GOOGLE_MAPS_ACCESS_TOKEN,
 5          BACKEND_URL: process.env.BACKEND_URL,
 6      },
 7      reactStrictMode: false,
 8      compiler: {
 9          removeConsole: process.env.NODE_ENV !== "development", // Remove console.log in production
10      },
11      experimental: {
12          missingSuspenseWithCSRBailout: false,
13      },
14  }
15  
16  // Configuration object tells the next-pwa plugin
17  const withPWA = require("@ducanh2912/next-pwa").default({
18      dest: "public", // Destination directory for the PWA files
19      disable: process.env.NODE_ENV === "development", // Disable PWA in development mode
20      cacheOnFrontEndNav: true,
21      aggressiveFrontEndNavCaching: true,
22      reloadOnOnline: true,
23      swcMinify: true,
24  });
25  
26  // Export the combined configuration for Next.js with PWA support
27  module.exports = withPWA(nextConfig);