next.config.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. const { PHASE_EXPORT } = require("next/constants");
  2. // /** @type {import('next').NextConfig} */
  3. const nextConfig = (phase, { defaultConfig }) => ({
  4. // webpack(config) {
  5. // // Grab the existing rule that handles SVG imports
  6. // const fileLoaderRule = config.module.rules.find((rule) =>
  7. // rule.test?.test?.('.svg'),
  8. // )
  9. // config.module.rules.push(
  10. // // Reapply the existing rule, but only for svg imports ending in ?url
  11. // {
  12. // ...fileLoaderRule,
  13. // test: /\.svg$/i,
  14. // resourceQuery: /url/, // *.svg?url
  15. // },
  16. // // Convert all other *.svg imports to React components
  17. // {
  18. // test: /\.svg$/i,
  19. // issuer: /\.[jt]sx?$/,
  20. // resourceQuery: { not: /url/ }, // exclude if *.svg?url
  21. // use: ['@svgr/webpack'],
  22. // },
  23. // )
  24. // // Modify the file loader rule to ignore *.svg, since we have it handled now.
  25. // fileLoaderRule.exclude = /\.svg$/i
  26. // return config
  27. // },
  28. output: phase === PHASE_EXPORT ? "export" : undefined,
  29. reactStrictMode: true,
  30. });
  31. module.exports = nextConfig;