-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
58 lines (54 loc) · 1.31 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/* eslint-disable @typescript-eslint/no-var-requires */
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
})
// eslint-disable-next-line import/no-extraneous-dependencies
const webpack = require('webpack')
const securityHeaders = [
{
key: 'Strict-Transport-Security',
value: 'max-age=63072000; includeSubDomains; preload',
},
]
module.exports = withBundleAnalyzer({
sassOptions: {
includePaths: ['./node_modules/@uswds/uswds/packages'],
},
webpack: (config, { buildId }) => {
config.plugins.push(
new webpack.DefinePlugin({
__VERSION__: JSON.stringify(process.env.npm_package_version),
__NEXT_BUILD_ID__: JSON.stringify(buildId),
__NODE_ENV__: JSON.stringify(process.env.NODE_ENV),
})
)
return config
},
reactStrictMode: true,
// swcMinify: true,
async headers() {
return [
{
// Apply these headers to all routes
source: '/(.*)',
headers: securityHeaders,
},
]
},
async redirects() {
return [
{
source: '/',
has: [
{
type: 'header',
key: 'User-Agent',
value: '(.*Trident.*)',
},
],
permanent: false,
destination: '/update-browser',
},
]
},
})