-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: installed pwa with serwist to install app from browser
- Loading branch information
1 parent
8dc9a01
commit d4088e2
Showing
15 changed files
with
445 additions
and
109 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,3 +38,7 @@ yarn-error.log* | |
# typescript | ||
*.tsbuildinfo | ||
next-env.d.ts | ||
|
||
# Serwist | ||
public/sw* | ||
public/swe-worker* |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{ | ||
} |
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,7 +1,19 @@ | ||
import type { NextConfig } from "next"; | ||
import type { NextConfig } from 'next'; | ||
import { PHASE_DEVELOPMENT_SERVER, PHASE_PRODUCTION_BUILD } from 'next/constants'; | ||
import serwist from '@serwist/next'; | ||
|
||
const nextConfig: NextConfig = { | ||
/* config options here */ | ||
const baseConfig = { | ||
// Base Next.js config | ||
}; | ||
|
||
export default nextConfig; | ||
export default async (phase: any) => { | ||
if (phase === PHASE_DEVELOPMENT_SERVER || phase === PHASE_PRODUCTION_BUILD) { | ||
const withSerwist = serwist({ | ||
swSrc: 'src/app/sw.ts', | ||
swDest: 'public/sw.js', | ||
}); | ||
return withSerwist(baseConfig); | ||
} | ||
|
||
return baseConfig; | ||
}; |
Oops, something went wrong.