-
Notifications
You must be signed in to change notification settings - Fork 62
/
next.config.js
73 lines (62 loc) · 1.97 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
const dotenv = require('dotenv').config();
const nextComposePlugins = require('next-compose-plugins');
const headers = require('./config/headers');
const plugins = require('./config/plugins');
const { i18n } = require('./next-i18next.config.js');
/**
* https://github.com/cyrilwanner/next-compose-plugins/issues/59
*/
const { withPlugins } = nextComposePlugins.extend(() => ({}));
/**
* Next config
* documentation: https://nextjs.org/docs/api-reference/next.config.js/introduction
*/
module.exports = withPlugins(plugins, {
i18n,
/**
* add the environment variables you would like exposed to the client here
* documentation: https://nextjs.org/docs/api-reference/next.config.js/environment-variables
*/
env: {
ENVIRONMENT_NAME: process.env.ENVIRONMENT_NAME,
},
/**
* The experimental option allows you to enable future/experimental options
* like React 18 concurrent features.
*/
experimental: {
// urlImports: true,
// concurrentFeatures: true,
// serverComponents: true,
},
/**
* SWC minification opt-in
* Please note that while not in experimental, the swcMinification may cause issues in your build.
* example: https://github.com/vercel/next.js/issues/30429 (Yup email validation causes an exception)
*/
// swcMinify: true,
poweredByHeader: false,
reactStrictMode: false,
compress: true,
/**
* add the headers you would like your next server to use
* documentation: https://nextjs.org/docs/api-reference/next.config.js/headers
* https://nextjs.org/docs/advanced-features/security-headers
*/
headers,
/**
* https://nextjs.org/docs/basic-features/image-optimization
* Settings are the defaults
*/
images: {
domains: ['images.ctfassets.net', 'images.eu.ctfassets.net'],
},
pageExtensions: ['page.tsx', 'page.ts', 'page.jsx', 'page.js'],
webpack(config) {
config.module.rules.push({
test: /\.svg$/,
use: ['@svgr/webpack'],
});
return config;
},
});