-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnext.config.mjs
57 lines (48 loc) · 1.32 KB
/
next.config.mjs
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
import NextBundleAnalyzer from '@next/bundle-analyzer'
import { config } from 'dotenv'
process.title = 'Hero (NextJS)'
const env = config().parsed || {}
const isProd = process.env.NODE_ENV === 'production'
/** @type {import('next').NextConfig} */
// eslint-disable-next-line import/no-mutable-exports
let nextConfig = {
reactStrictMode: false,
productionBrowserSourceMaps: true,
output: 'standalone',
assetPrefix: isProd ? env.ASSETPREFIX || undefined : undefined,
compiler: {
// reactRemoveProperties: { properties: ['^data-id$', '^data-(\\w+)-id$'] },
},
images: {
remotePatterns: [
{
protocol: 'https',
hostname: '**',
},
],
dangerouslyAllowSVG: true,
contentSecurityPolicy:
"default-src 'self'; script-src 'none'; sandbox; style-src 'unsafe-inline';",
},
async rewrites() {
return {
beforeFiles: [
{ source: '/atom.xml', destination: '/feed' },
{ source: '/sitemap.xml', destination: '/sitemap' },
],
}
},
webpack: (config, options) => {
config.externals.push({
'utf-8-validate': 'commonjs utf-8-validate',
bufferutil: 'commonjs bufferutil',
})
return config
},
}
if (process.env.ANALYZE === 'true') {
nextConfig = NextBundleAnalyzer({
enabled: true,
})(nextConfig)
}
export default nextConfig