Skip to content

Commit

Permalink
feat PWA
Browse files Browse the repository at this point in the history
  • Loading branch information
AhmedBaset committed Jul 11, 2023
1 parent 4fef803 commit d422f4e
Show file tree
Hide file tree
Showing 6 changed files with 2,481 additions and 101 deletions.
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,12 @@ yarn-error.log*
.turbo

.contentlayer
.env
.env

# PWA
**/public/sw.js
**/public/workbox-*.js
**/public/worker-*.js
**/public/sw.js.map
**/public/workbox-*.js.map
**/public/worker-*.js.map
12 changes: 10 additions & 2 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
// @ts-check

const { withContentlayer } = require('next-contentlayer')
const withPWA = require("@ducanh2912/next-pwa").default({
dest: "public",
register: true,
disable: process.env.NODE_ENV === "development",
scope: "/app",
})

/** @type {import('next').NextConfig} */
const nextConfig = {
images: {
domains: ["picsum.photos", "github.com", "localhost"],
domains: ["github.com", "localhost"],
},
}

module.exports = withContentlayer(nextConfig)
module.exports = withContentlayer(withPWA(nextConfig))
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"fix-all": "pnpm format && pnpm lint:fix"
},
"dependencies": {
"@ducanh2912/next-pwa": "^9.2.0",
"@radix-ui/react-alert-dialog": "^1.0.4",
"@radix-ui/react-avatar": "^1.0.3",
"@radix-ui/react-dialog": "^1.0.4",
Expand All @@ -30,6 +31,7 @@
"lucide-react": "^0.248.0",
"next": "13.4.7",
"next-contentlayer": "^0.3.3",
"next-pwa": "^5.6.0",
"next-themes": "^0.2.1",
"react": "18.2.0",
"react-dom": "18.2.0",
Expand Down
Loading

0 comments on commit d422f4e

Please sign in to comment.