-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.js
More file actions
69 lines (64 loc) · 1.32 KB
/
next.config.js
File metadata and controls
69 lines (64 loc) · 1.32 KB
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
59
60
61
62
63
64
65
66
67
68
69
if (!process.env.WP_DOMAIN) {
throw new Error(`
Please provide a valid WordPress instance Domain.
Set to the environment variables WP_DOMAIN.
`)
}
/** @type {import('next').NextConfig} */
// Doc: https://www.npmjs.com/package/@next/bundle-analyzer
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true'
})
module.exports = withBundleAnalyzer({
reactStrictMode: true,
images: {
remotePatterns: [
{
protocol: 'https',
hostname: process.env.WP_DOMAIN
},
{
protocol: 'https',
hostname: '0.gravatar.com'
},
{
protocol: 'https',
hostname: '1.gravatar.com'
},
{
protocol: 'https',
hostname: '2.gravatar.com'
},
{
protocol: 'https',
hostname: 'drive.google.com'
},
{
protocol: 'https',
hostname: 'secure.gravatar.com'
}
]
},
output: 'standalone',
webpack: (config) => {
// Fixes npm packages that depend on `fs` module
config.resolve.fallback = {
...config.resolve.fallback,
fs: false
}
config.module.rules.push({
test: /\.svg$/,
use: ['@svgr/webpack']
})
return config
},
i18n: {
locales: ['en'],
defaultLocale: 'en'
},
eslint: {
// Note: linting is already run on PRs into development;
// Doing it during build-time is duplicative
ignoreDuringBuilds: true
}
})