-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.mjs
More file actions
39 lines (32 loc) · 809 Bytes
/
next.config.mjs
File metadata and controls
39 lines (32 loc) · 809 Bytes
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
/** @type {import('next').NextConfig} */
import analyzeBundle from '@next/bundle-analyzer'
const packageJSON = await import('./package.json', {
assert: { type: 'json' },
})
const withBundleAnalyzer = analyzeBundle({
enabled: process.env.ANALYZE === 'true',
})
const nextConfig = withBundleAnalyzer({
output: 'export',
distDir: './dist',
cleanDistDir: true,
reactStrictMode: false,
webpack(config, { webpack }) {
config.module.rules.push({
test: /\.svg$/,
use: ['@svgr/webpack'],
})
if (process.env.NODE_ENV === 'production') {
config.plugins.push(
new webpack.DefinePlugin({
'globalThis.__DEV__': false,
}),
)
}
return config
},
env: {
version: packageJSON?.default?.version,
},
})
export default nextConfig