-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnext.config.js
40 lines (39 loc) · 1.12 KB
/
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
const { i18n } = require('./next-i18next.config')
const APP_ENV = process.env.APP_ENV === 'development' ? 'development' : 'production'
const env = require(APP_ENV === 'development' ? './.env.development.js' : './.env.production.js')
module.exports = {
i18n,
productionBrowserSourceMaps: true,
env: { APP_ENV, ...env },
generateBuildId: async () => String(Math.round(Number(new Date()) / 1000)),
distDir: 'build',
compress: false,
poweredByHeader: false,
devIndicators: {
autoPrerender: false,
},
reactStrictMode: true,
webpack(config) {
config.module.rules.push({
test: /\.svg$/i,
// issuer section restricts svg as component only to
// svgs imported from js / ts files.
//
// This allows configuring other behavior for
// svgs imported from other file types (such as .css)
issuer: { and: [/\.(js|ts|md)x?$/] },
use: [
{
loader: '@svgr/webpack',
options: {
svgoConfig: { plugins: [{ removeViewBox: false }] },
},
},
{
loader: 'url-loader',
},
],
})
return config
},
}