-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathnext.config.js
35 lines (32 loc) · 979 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
var webpack = require('webpack')
var withOffline = require('next-offline')
var withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
})
const config = {
target: 'serverless',
env: {
APP_ID: process.env.APP_ID,
},
workboxOpts: {
runtimeCaching: [
{
urlPattern: /^https:\/\/fonts\.googleapis\.com/,
handler: 'cacheFirst',
options: {
cacheName: 'google-fonts-stylesheets',
expiration: { maxEntries: 100, maxAgeSeconds: 60 * 60 * 24 * 30 },
cacheableResponse: {
statuses: [0, 200],
},
},
},
{ urlPattern: /^https?.*/, handler: 'networkFirst' },
],
// Not sure adding display swap is actually working (i see fetch for plain still after)
// importScripts: ['static/js/service-worker-extras.js'],
skipWaiting: true,
clientsClaim: true,
},
}
module.exports = withBundleAnalyzer(withOffline(config))