-
Notifications
You must be signed in to change notification settings - Fork 95
/
next.config.js
39 lines (34 loc) · 867 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
34
35
36
37
38
39
// eslint-disable-next-line import/no-extraneous-dependencies
const { StatsWriterPlugin } = require('webpack-stats-plugin');
const commit = require('child_process')
.execSync('git rev-parse --short HEAD')
.toString()
.trim();
/** @type {import('next').NextConfig} */
const nextConfig = {
output: 'export',
eslint: {
ignoreDuringBuilds: true,
},
webpack: (config, options) => {
const { dev, isServer } = options;
// Output webpack stats JSON file only for client-side/production build
if (!dev && !isServer) {
config.plugins.push(
new StatsWriterPlugin({
filename: '../webpack-stats.json',
stats: {
assets: true,
chunks: true,
modules: true,
},
})
);
}
return config;
},
env: {
commit,
},
};
module.exports = nextConfig;