Skip to content

Commit

Permalink
Merge pull request #323 from near/pwa
Browse files Browse the repository at this point in the history
introduce pwa configs
  • Loading branch information
charleslavon authored Feb 5, 2024
2 parents 2c96b2d + 3c85980 commit dfc87f1
Show file tree
Hide file tree
Showing 10 changed files with 2,260 additions and 146 deletions.
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,19 @@
.pnp.js
.pnpm-store


# generated pwa-files
**/public/precache.*.*.js
**/public/next-pwa-sw.js
**/public/next-pwa-sw.js.map
**/public/workbox-*.js
**/public/worker-*.js
**/public/fallback-*.js
**/public/precache.*.*.js.map
**/public/workbox-*.js.map
**/public/worker-*.js.map
**/public/fallback-*.js

# testing
/coverage

Expand Down
13 changes: 12 additions & 1 deletion next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,18 @@ const nextConfig = {
]
};

module.exports = nextConfig;
const withPWA = require('next-pwa')({
dest: 'public',
sw: 'next-pwa-sw.js',
importScripts: ['/pwa.js'],
cacheStartUrl: false,
cacheOnFrontEndNav: true,
skipWaiting: false
})
const { loadEnvConfig } = require('@next/env');
loadEnvConfig(".")
if(!process.env.NEXT_PUBLIC_LOCAL_ENVIRONMENT)
module.exports = withPWA(nextConfig);

// Injected content via Sentry wizard below

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"near-fastauth-wallet": "^0.0.10",
"near-social-vm": "github:NearSocial/VM#address-bn",
"next": "^13.5.6",
"next-pwa": "^5.6.0",
"react": "^18.2.0",
"react-bootstrap": "^2.5.0",
"react-bootstrap-typeahead": "^6.1.2",
Expand Down
Loading

0 comments on commit dfc87f1

Please sign in to comment.