This repository has been archived by the owner on Jun 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
63 lines (58 loc) · 1.82 KB
/
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// @ts-check
/* eslint-disable @typescript-eslint/no-var-requires */
const runtimeCaching = require('next-pwa/cache');
const withPWA = require('next-pwa');
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.NODE_ENV === 'production'
});
/**
* @type {import('next/dist/next-server/server/config').NextConfig}
* @description Application customizations
*/
module.exports = withBundleAnalyzer(
withPWA({
/**
* @external https://nextjs.org/docs/api-reference/next.config.js/environment-variables
*/
env: {
CLIENT_URL: process.env.CLIENT_URL,
GOOGLE_ANALYTICS: process.env.GOOGLE_ANALYTICS,
GOOGLE_TAG_MANAGER: process.env.GOOGLE_TAG_MANAGER,
GRAPHCMS_ADMIN: process.env.GRAPHCMS_ADMIN,
GRAPHCMS_TOKEN: process.env.GRAPHCMS_TOKEN,
GRAPHCMS_URL: process.env.GRAPHCMS_URL
},
/**
* @external https://nextjs.org/docs/basic-features/eslint
* Warning: Dangerously allow production builds to successfully
* complete even if your project has ESLint errors.
*/
eslint: {
ignoreDuringBuilds: true
},
/**
* @external https://www.npmjs.com/package/next-pwa
* @description Configure our SW (service worker) here making it
* INCREDIBLY easy to get our PWA/Lighthouse scores up and improve UX
*/
pwa: {
buildExcludes: [/middleware-manifest\.json/],
cacheOnFrontEndNav: true,
dest: 'public',
disable: process.env.NODE_ENV !== 'production',
publicExcludes: [
'!**/middleware-manifest.json',
'!fonts/**/*.ttf',
'!fonts/**/*.woff',
// '!fonts/**/*.woff2',
'!images/**/*.jpg',
'!images/**/*.png',
'!images/**/*.svg'
// '!images/**/*.webp',
],
register: true,
runtimeCaching,
sw: 'worker.js'
}
})
);