Skip to content

Commit

Permalink
Fix pwa HOC issue from next-pwa
Browse files Browse the repository at this point in the history
  • Loading branch information
wajeshubham committed Feb 3, 2023
1 parent afbd43c commit f25eade
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 23 deletions.
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,14 @@ yarn-error.log*
# typescript
*.tsbuildinfo
next-env.d.ts

# PWA files

**/public/sw.js
**/public/workbox-*.js
**/public/worker-*.js
**/public/sw.js.map
**/public/workbox-*.js.map
**/public/worker-*.js.map
**/public/fallback-*.js.map
**/public/fallback-*.js
22 changes: 8 additions & 14 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
const withPWA = require("next-pwa");
const withPWA = require("next-pwa")({
dest: "public",
register: true,
disable: process.env.NODE_ENV !== "production",
skipWaiting: true,
});

/** @type {import('next').NextConfig} */
const nextConfig = {
module.exports = withPWA({
// nextConfig
reactStrictMode: true,
output: "standalone",
};

module.exports = withPWA({
pwa: {
dest: "public",
register: true,
disable: process.env.NODE_ENV !== "production",
skipWaiting: true,
},
});

module.exports = nextConfig;
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
"firebase": "^9.16.0",
"html-to-image": "^1.11.4",
"next": "13.1.5",
"next-pwa": "5.5.4",
"next-compose-plugins": "^2.2.1",
"next-pwa": "^5.6.0",
"react": "18.2.0",
"react-dom": "18.2.0",
"typescript": "4.9.4"
Expand Down
21 changes: 13 additions & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5642,17 +5642,22 @@ natural-compare@^1.4.0:
resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7"
integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==

[email protected]:
version "5.5.4"
resolved "https://registry.yarnpkg.com/next-pwa/-/next-pwa-5.5.4.tgz#5a96bb4762c649ed875e5d98a1183132c0199f49"
integrity sha512-EgB2MQWGR8oZDzY6US+/D0LOCUhPZYCgeqRVBYDxQWNi0N6XfQOoZPw2COIrg/eMt/rB0M+/mquhAQACs5v4Ag==
next-compose-plugins@^2.2.1:
version "2.2.1"
resolved "https://registry.yarnpkg.com/next-compose-plugins/-/next-compose-plugins-2.2.1.tgz#020fc53f275a7e719d62521bef4300fbb6fde5ab"
integrity sha512-OjJ+fV15FXO2uQXQagLD4C0abYErBjyjE0I0FHpOEIB8upw0hg1ldFP6cqHTJBH1cZqy96OeR3u1dJ+Ez2D4Bg==

next-pwa@^5.6.0:
version "5.6.0"
resolved "https://registry.yarnpkg.com/next-pwa/-/next-pwa-5.6.0.tgz#f7b1960c4fdd7be4253eb9b41b612ac773392bf4"
integrity sha512-XV8g8C6B7UmViXU8askMEYhWwQ4qc/XqJGnexbLV68hzKaGHZDMtHsm2TNxFcbR7+ypVuth/wwpiIlMwpRJJ5A==
dependencies:
babel-loader "^8.2.5"
clean-webpack-plugin "^4.0.0"
globby "^11.0.4"
terser-webpack-plugin "^5.3.3"
workbox-webpack-plugin "^6.5.3"
workbox-window "^6.5.3"
workbox-webpack-plugin "^6.5.4"
workbox-window "^6.5.4"

next-router-mock@^0.9.1:
version "0.9.1"
Expand Down Expand Up @@ -7298,7 +7303,7 @@ [email protected]:
resolved "https://registry.yarnpkg.com/workbox-sw/-/workbox-sw-6.5.4.tgz#d93e9c67924dd153a61367a4656ff4d2ae2ed736"
integrity sha512-vo2RQo7DILVRoH5LjGqw3nphavEjK4Qk+FenXeUsknKn14eCNedHOXWbmnvP4ipKhlE35pvJ4yl4YYf6YsJArA==

workbox-webpack-plugin@^6.5.3:
workbox-webpack-plugin@^6.5.4:
version "6.5.4"
resolved "https://registry.yarnpkg.com/workbox-webpack-plugin/-/workbox-webpack-plugin-6.5.4.tgz#baf2d3f4b8f435f3469887cf4fba2b7fac3d0fd7"
integrity sha512-LmWm/zoaahe0EGmMTrSLUi+BjyR3cdGEfU3fS6PN1zKFYbqAKuQ+Oy/27e4VSXsyIwAw8+QDfk1XHNGtZu9nQg==
Expand All @@ -7309,7 +7314,7 @@ workbox-webpack-plugin@^6.5.3:
webpack-sources "^1.4.3"
workbox-build "6.5.4"

[email protected], workbox-window@^6.5.3:
[email protected], workbox-window@^6.5.4:
version "6.5.4"
resolved "https://registry.yarnpkg.com/workbox-window/-/workbox-window-6.5.4.tgz#d991bc0a94dff3c2dbb6b84558cff155ca878e91"
integrity sha512-HnLZJDwYBE+hpG25AQBO8RUWBJRaCsI9ksQJEp3aCOFCaG5kqaToAYXFRAHxzRluM2cQbGzdQF5rjKPWPA1fug==
Expand Down

0 comments on commit f25eade

Please sign in to comment.