✨(service-worker) add service worker api to impress app
This commit adds the service worker api to the impress app. The service worker api will cache the api calls in the indexdb. We are using the network first strategy to fetch the data. If the network is not available, we will fetch the data from the indexdb. To do that, we create a custom plugin (ApiPlugin).
This commit is contained in:
@@ -36,7 +36,7 @@ const nextConfig = {
|
||||
if (!isServer && process.env.NEXT_PUBLIC_SW_DEACTIVATED !== 'true') {
|
||||
config.plugins.push(
|
||||
new InjectManifest({
|
||||
swSrc: './src/core/service-worker.ts',
|
||||
swSrc: './src/core/service-worker/service-worker.ts',
|
||||
swDest: '../public/service-worker.js',
|
||||
include: [
|
||||
({ asset }) => {
|
||||
|
||||
Reference in New Issue
Block a user