-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathnext.config.js
More file actions
41 lines (37 loc) · 1.21 KB
/
Copy pathnext.config.js
File metadata and controls
41 lines (37 loc) · 1.21 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
/** @type {import('next').NextConfig} */
let envWarningShown = false;
const nextConfig = {
reactStrictMode: true,
optimizeFonts: false,
images: {
remotePatterns: [{ protocol: 'https', hostname: '*.tile.openstreetmap.org' }],
},
eslint: {
ignoreDuringBuilds: false,
},
webpack: (config, { dev }) => {
if (dev && !envWarningShown) {
try {
const { validateEnvironment } = require('./lib/env');
const result = validateEnvironment();
if (!result.valid) {
console.warn('\n Environment variable check:');
result.missing.forEach((v) => console.warn(` MISSING: ${v}`));
console.warn(' Run `npm run validate:env` for details.\n');
}
if (result.warnings.length > 0) {
console.info('\n Optional env var warnings:');
result.warnings.forEach((w) => console.info(` ${w}`));
console.info();
}
} catch {
// lib/env might not be resolvable at webpack config time
}
envWarningShown = true;
}
return config;
},
};
const createNextIntlPlugin = require('next-intl/plugin');
const withNextIntl = createNextIntlPlugin('./i18n/request.ts');
module.exports = withNextIntl(nextConfig);