-
Notifications
You must be signed in to change notification settings - Fork 2
/
next.config.js
67 lines (64 loc) · 2 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
64
65
66
67
const withOffline = require('next-offline');
const path = require('path');
const env = {
FIREBASE_AUTH_DOMAIN: process.env.FIREBASE_AUTH_DOMAIN,
FIREBASE_DATABASE_URL: process.env.FIREBASE_DATABASE_URL,
FIREBASE_PROJECT_ID: process.env.FIREBASE_PROJECT_ID,
FIREBASE_PUBLIC_API_KEY: process.env.FIREBASE_PUBLIC_API_KEY,
FIREBASE_STORAGE_BUCKET: process.env.FIREBASE_STORAGE_BUCKET,
FIREBASE_MESSAGEING_SENDER_ID: process.env.FIREBASE_MESSAGEING_SENDER_ID,
FIREBASE_APP_ID: process.env.FIREBASE_APP_ID,
FIREBASE_CLIENT_EMAIL: process.env.FIREBASE_CLIENT_EMAIL,
GOOGLE_ANALYTICS_TRAKING_ID: process.env.GOOGLE_ANALYTICS_TRAKING_ID,
GOOGLE_ANALYTICS_MEASUREMENT_ID: process.env.GOOGLE_ANALYTICS_MEASUREMENT_ID,
FULLSTORY_ORG: process.env.FULLSTORY_ORG,
FACEBOOK_APP_ID: process.env.FACEBOOK_APP_ID,
DISQUS_SHORTNAME: process.env.DISQUS_SHORTNAME,
};
const nextConfig = {
env,
output: 'standalone',
webpack: config => {
// eslint-disable-next-line no-param-reassign
config.resolve.alias['@'] = path.resolve(__dirname, '.');
return config;
},
images: {
domains: ['firebasestorage.googleapis.com'],
},
workboxOpts: {
swDest: 'static/service-worker.js',
runtimeCaching: [
{
urlPattern: /^https?.*/,
handler: 'NetworkFirst',
options: {
cacheName: 'https-calls',
networkTimeoutSeconds: 15,
expiration: {
maxEntries: 150,
maxAgeSeconds: 30 * 24 * 60 * 60, // 1 month
},
cacheableResponse: {
statuses: [0, 200],
},
},
},
{
urlPattern: /\.(?:png|gif|jpg|jpeg|webp|svg)$/,
handler: 'CacheFirst',
options: {
cacheName: 'static-cache',
expiration: {
maxEntries: 150,
maxAgeSeconds: 30 * 24 * 60 * 60, // 1 month
},
cacheableResponse: {
statuses: [0, 200],
},
},
},
],
},
};
module.exports = withOffline(nextConfig);