-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
41 lines (38 loc) · 961 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
40
41
const withCSS = require('@zeit/next-css')
const withSASS = require('@zeit/next-sass')
const withSourceMaps = require('@zeit/next-source-maps')
const ManifestPlugin = require('webpack-manifest-plugin')
const OptimizeJsPlugin = require('optimize-js-plugin')
module.exports = withSourceMaps(
withSASS(
withCSS({
webpack (config, {buildId, dev, isServer, defaultLoaders}) {
config.module.rules.push(
{
test: /\.(jpe?g|png|svg|gif)$/,
use: [
{
loader: 'url-loader',
options: {
limit: dev ? 256 : 8192,
publicPath: '/_next/static/images/',
outputPath: 'static/images/',
name: '[name]-[hash].[ext]'
}
}
]
},
{
test: /\.md$/,
use: ['babel-loader', '@mdx-js/loader']
}
)
if (!dev && !isServer) {
config.plugins.push(new OptimizeJsPlugin(), new ManifestPlugin())
return config
}
return config
}
})
)
)