|
1 | 1 | /** @type {import('next').NextConfig} */
|
| 2 | + |
| 3 | +// const path = require("path"); |
| 4 | +const withPlugins = require("next-compose-plugins"); |
| 5 | +const { i18n } = require("./next-i18next.config"); |
| 6 | +const withPWA = require("next-pwa"); |
| 7 | +// const runtimeCaching = require("next-pwa/cache"); |
| 8 | + |
| 9 | +// const withBundleAnalyzer = require("@next/bundle-analyzer")({ |
| 10 | +// enabled: process.env.ANALYZE === "true", |
| 11 | +// }); |
| 12 | + |
2 | 13 | const nextConfig = {
|
| 14 | + publicRuntimeConfig: { |
| 15 | + canonicalDomain: "https://domain.com", |
| 16 | + }, |
| 17 | + |
3 | 18 | reactStrictMode: true,
|
4 |
| -} |
5 | 19 |
|
6 |
| -module.exports = nextConfig |
| 20 | + images: { |
| 21 | + domains: [process.env.NEXT_IMAGE_DOMAIN], |
| 22 | + }, |
| 23 | + |
| 24 | + i18n, |
| 25 | + |
| 26 | + experimental: { |
| 27 | + outputStandalone: true, |
| 28 | + }, |
| 29 | + |
| 30 | + // sassOptions: { |
| 31 | + // includePaths: [path.join(__dirname, "styles")], |
| 32 | + // }, |
| 33 | + |
| 34 | + // // https://nextjs.org/docs/api-reference/next.config.js/redirects |
| 35 | + // async redirects() { |
| 36 | + // return [ |
| 37 | + // { |
| 38 | + // source: "/about", |
| 39 | + // destination: "/", |
| 40 | + // permanent: true, |
| 41 | + // }, |
| 42 | + // ]; |
| 43 | + // }, |
| 44 | + |
| 45 | + // // https://nextjs.org/docs/api-reference/next.config.js/rewrites |
| 46 | + // async rewrites() { |
| 47 | + // return [ |
| 48 | + // { |
| 49 | + // source: "/ru/front", |
| 50 | + // destination: "/ru", |
| 51 | + // locale: false, |
| 52 | + // }, |
| 53 | + // { |
| 54 | + // source: "/en/front", |
| 55 | + // destination: "/en", |
| 56 | + // locale: false, |
| 57 | + // }, |
| 58 | + // ]; |
| 59 | + // }, |
| 60 | + |
| 61 | + // typescript: { |
| 62 | + // // !! WARN !! |
| 63 | + // // Dangerously allow production builds to successfully complete even if |
| 64 | + // // your project has type errors. |
| 65 | + // // !! WARN !! |
| 66 | + // ignoreBuildErrors: true, |
| 67 | + // }, |
| 68 | +}; |
| 69 | + |
| 70 | +module.exports = withPlugins([ |
| 71 | + // [withBundleAnalyzer({})], |
| 72 | + [ |
| 73 | + withPWA, |
| 74 | + { |
| 75 | + pwa: { |
| 76 | + dest: "public", |
| 77 | + disable: process.env.NODE_ENV === "development", |
| 78 | + register: true, |
| 79 | + sw: "/sw.js", |
| 80 | + // runtimeCaching, |
| 81 | + }, |
| 82 | + }, |
| 83 | + ], |
| 84 | + [nextConfig], |
| 85 | +]); |
0 commit comments