/
next.config.js
40 lines (34 loc) · 914 Bytes
/
next.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// /** @type {import('next').NextConfig} */
// const nextConfig = {
// reactStrictMode: true,
// }
// module.exports = nextConfig
const withPWA = require('next-pwa')
const runtimeCaching = require('next-pwa/cache')
const generateRobotsTxt = require('./scripts/robots')
const nextConfiguration = {
// images: {
// domains: [process.env.DOMAIN],
// },
webpack(config) {
config.module.rules.push({
test: /\.svg$/,
use: ['@svgr/webpack'],
})
// robots.txt
generateRobotsTxt()
return config
},
pwa: {
disable: process.env.NODE_ENV === 'development', // disable during development
dest: 'public',
runtimeCaching,
},
i18n: {
locales: ['en'],
defaultLocale: 'en',
},
// Browse sourcemaps in dev environment by yarn analyze
productionBrowserSourceMaps: process.env.NODE_ENV === 'development',
}
module.exports = withPWA(nextConfiguration)