-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnext.config.js
42 lines (40 loc) · 1.22 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
41
42
const { createSecureHeaders } = require("next-secure-headers");
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true'
});
module.exports = withBundleAnalyzer({
i18n: {
// These are all the locales you want to support in
// your application
locales: ["en"],
// This is the default locale you want to be used when visiting
// a non-locale prefixed path e.g. `/hello`
defaultLocale: "en",
},
generateBuildId: () => 'build',
async headers() {
return [{
source: "/(.*)",
headers: createSecureHeaders({
forceHTTPSRedirect: [true, { maxAge: 60 * 60 * 24 * 4, includeSubDomains: true }],
referrerPolicy: "same-origin",
})
}];
},
webpack(config) {
config.module.rules.push({
test: /\.svg$/,
use: [{
loader: '@svgr/webpack',
options: {
svgoConfig: {
plugins: [
{ removeViewbox: false },
],
},
},
}],
});
return config;
},
});