-
Notifications
You must be signed in to change notification settings - Fork 92
/
next.config.js
25 lines (22 loc) · 721 Bytes
/
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
const optimizedImages = require('next-optimized-images');
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
});
const redirects = require('./data/redirects.json');
const rewrites =
process.env.NEXT_PUBLIC_FEATURE_ENV === 'staging'
? require('./data/rewrites-staging.json')
: require('./data/rewrites.json');
const nextConfig = {
redirects: async () => redirects,
rewrites: async () => rewrites,
trailingSlash: true,
images: {
disableStaticImages: true,
},
};
module.exports = () => {
const plugins = [withBundleAnalyzer, optimizedImages];
const config = plugins.reduce((acc, next) => next(acc), { ...nextConfig });
return config;
};