-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.js
More file actions
31 lines (26 loc) · 772 Bytes
/
next.config.js
File metadata and controls
31 lines (26 loc) · 772 Bytes
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
module.exports = () => ({
webpack: (config, options) => {
config.module.rules.push({
test: /\.(jpe?g|png|webp)$/i,
use: {
loader: 'responsive-loader',
options: {
adapter: require('responsive-loader/sharp'),
publicPath: '/_next/static/images/',
outputPath: `${options.isServer ? '../' : ''}static/images/`,
sizes: [320, 640, 960, 1200],
placeholder: true,
},
},
})
if (!options.dev && options.isServer) {
const originalEntry = config.entry
config.entry = async () => {
const entries = { ...(await originalEntry()) }
entries['scripts/build-rss'] = [`./scripts/build-rss`]
return entries
}
}
return config
},
})