generated from zmh-program/akiapp-next-template
-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d098dae
commit 3e72fc2
Showing
5 changed files
with
30 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,31 @@ | ||
/** @type {import('next').NextConfig} */ | ||
|
||
import setupPWA from 'next-pwa'; | ||
|
||
const nextConfig = { | ||
reactStrictMode: true, | ||
}; | ||
|
||
export default nextConfig; | ||
const withPWA = setupPWA({ | ||
dest: 'public', | ||
disable: process.env.NODE_ENV === 'development', | ||
register: true, | ||
skipWaiting: true, | ||
buildExcludes: [/manifest\.json$/, /_next\/data/, /_next\/static/], | ||
runtimeCaching: [ | ||
// cache *.css, *.js, *.woff2 files | ||
{ | ||
urlPattern: /^https?.*\.(css|js|woff2)$/, | ||
handler: 'CacheFirst', | ||
options: { | ||
cacheName: 'assets-cache', | ||
expiration: { | ||
maxEntries: 200, | ||
maxAgeSeconds: 7 * 24 * 60 * 60, // 7 days | ||
}, | ||
} | ||
}, | ||
], | ||
}); | ||
|
||
export default withPWA(nextConfig); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters