-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
27 lines (27 loc) · 931 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
module.exports = {
webpack: (config, { buildId, dev, isServer, defaultLoaders, webpack }) => {
// Note: we provide webpack above so you should not `require` it
// Perform customizations to webpack config
// Important: return the modified config
config.plugins.push(new webpack.IgnorePlugin(/\/__tests__\//));
config.module.rules.push({
test: /\.(woff(2)?|ttf|eot|svg|png|jpg|jpeg|gif)$/,
use: [
defaultLoaders.babel,
{ loader: 'file-loader', options: {
name(file) {
if (process.env.NODE_ENV === 'development') {
return '[path][name].[ext]';
}
return '[contenthash].[ext]';
} } }
],
});
return config
},
webpackDevMiddleware: (config, options) => {
// Perform customizations to webpack dev mid dleware config
// Important: return the modified config
return config
},
};