next.config.js 538 B

123456789101112131415161718192021222324252627
  1. const withPWA = require("next-pwa");
  2. const runtimeCaching = require("next-pwa/cache");
  3. /**
  4. * @type {import('next').NextConfig}
  5. */
  6. const nextConfig = {
  7. reactStrictMode: true,
  8. exportPathMap: () => ({
  9. "/": { page: "/" },
  10. "/editor": { page: "/editor" },
  11. }),
  12. compiler: {
  13. styledComponents: true,
  14. },
  15. pwa: {
  16. disable: process.env.NODE_ENV === "development",
  17. runtimeCaching,
  18. dest: "public",
  19. register: true,
  20. fallbacks: {
  21. document: "/editor",
  22. },
  23. },
  24. };
  25. module.exports = withPWA(nextConfig);