forked from rtCamp/wp-decoupled
-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
35 lines (31 loc) · 960 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
const withCss = require('@zeit/next-css');
const path = require('path');
const withOffline = require('next-offline');
const withSass = require('@zeit/next-sass');
const workBoxOptions = {
workboxOpts: {
swSrc: 'service-worker.js',
swDest: 'static/service-worker.js',
exclude: [/.+error\.js$/, /\.map$/]
}
};
const backend_hostname = new URL(process.env.NEXT_PUBLIC_WOO_SITE_URL).hostname;
module.exports = withOffline(
withCss(
withSass({
workboxOpts: workBoxOptions.workboxOpts,
generateInDevMode: true,
dontAutoRegisterSw: true,
generateSw: false,
globPatterns: ['static/**/*'],
globDirectory: '.',
target: 'serverless',
images: {
domains: [
backend_hostname,
'https://via.placeholder.com'
],
},
})
)
);