forked from deptagency/dept-weather
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.js
More file actions
29 lines (26 loc) · 727 Bytes
/
next.config.js
File metadata and controls
29 lines (26 loc) · 727 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
/** @type {import('next').NextConfig} */
const withPWA = require('next-pwa')({
dest: 'public'
});
const STATIC_ASSET_CACHE_HEADERS = [
{
key: 'Cache-Control',
value: 'public, immutable, max-age=7776000' // 90 days
}
];
const CACHED_STATIC_ASSET_SOURCES = [
'/icons/(.*)',
'/splash-screens/(.*)',
'/weather-icons/(.*)',
'/cities-top10000-gid-cache.json',
'/favicon.svg'
];
const nextConfig = {
reactStrictMode: true,
async headers() {
return process.env.NODE_ENV !== 'development'
? CACHED_STATIC_ASSET_SOURCES.map(source => ({ source, headers: STATIC_ASSET_CACHE_HEADERS }))
: [];
}
};
module.exports = process.env.NODE_ENV !== 'development' ? withPWA(nextConfig) : nextConfig;