-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
33 lines (30 loc) · 1006 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
26
27
28
29
30
31
32
33
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.NEXT_PUBLIC_APP_ANALYZE === 'true' || process.env.ANALYZE === 'true',
});
const nextBuildId = require('next-build-id');
const withPlugins = require('next-compose-plugins');
const isProd = process.env.NEXT_PUBLIC_APP_ENV === 'production';
const nextConfig = {
webpack: function (config) {
config.module.rules.push({
test: /\.(eot|woff|woff2|ttf|svg|png|jpg|gif)$/,
use: {
loader: 'url-loader',
options: {
limit: 100000,
name: '[name].[ext]',
},
},
});
return config;
},
// Indicator from next for prerendered page status
devIndicators: {
autoPrerender: !isProd,
},
// Setting a custom build directory & build id
generateBuildId: () => nextBuildId({ dir: __dirname, describe: true }),
// Disabling x-powered-by in response headers
poweredByHeader: false,
};
module.exports = withPlugins([[withBundleAnalyzer]], nextConfig);