Skip to content

Commit

Permalink
Enable PWA
Browse files Browse the repository at this point in the history
  • Loading branch information
BrunoBernardino committed Sep 11, 2021
1 parent 17b7f22 commit fd0e464
Show file tree
Hide file tree
Showing 9 changed files with 7,174 additions and 417 deletions.
46 changes: 27 additions & 19 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,31 @@
const path = require('path');
const withSass = require('@zeit/next-sass');
const withCss = require('@zeit/next-css');
const withPWA = require('next-pwa');

module.exports = withCss(
withSass({
target: 'serverless',
sassLoaderOptions: {
includePaths: [
path.join(__dirname, 'styles'),
path.join(__dirname, 'node_modules'),
],
},
webpack(config) {
config.resolve.alias.pages = path.join(__dirname, 'pages');
config.resolve.alias.components = path.join(__dirname, 'components');
config.resolve.alias.modules = path.join(__dirname, 'modules');
config.resolve.alias.lib = path.join(__dirname, 'lib');
config.resolve.alias.styles = path.join(__dirname, 'styles');
return config;
},
}),
);
module.exports = withPWA({
pwa: {
dest: 'public',
register: true,
skipWaiting: true,
},
...withCss(
withSass({
target: 'serverless',
sassLoaderOptions: {
includePaths: [
path.join(__dirname, 'styles'),
path.join(__dirname, 'node_modules'),
],
},
webpack(config) {
config.resolve.alias.pages = path.join(__dirname, 'pages');
config.resolve.alias.components = path.join(__dirname, 'components');
config.resolve.alias.modules = path.join(__dirname, 'modules');
config.resolve.alias.lib = path.join(__dirname, 'lib');
config.resolve.alias.styles = path.join(__dirname, 'styles');
return config;
},
}),
),
});
4,665 changes: 4,267 additions & 398 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"ky": "0.25.0",
"moment": "2.29.1",
"next": "10.0.2",
"next-pwa": "5.3.1",
"node-sass": "5.0.0",
"pouchdb-adapter-http": "7.2.2",
"pouchdb-adapter-idb": "7.2.2",
Expand Down
1 change: 1 addition & 0 deletions pages/_document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export default class MyDocument extends Document {
<meta name="theme-color" content="#ffffff" />
<link rel="icon" type="image/png" href="/images/favicon.png" />
<link rel="apple-touch-icon" href="/images/favicon.png" />
<link rel="manifest" href="/manifest.json" />
<link
rel="alternate"
type="application/rss+xml"
Expand Down
16 changes: 16 additions & 0 deletions public/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "Budget Zen",
"short_name": "Budget Zen",
"icons": [
{
"src": "/images/logo.svg",
"sizes": "any",
"type": "image/svg+xml"
}
],
"theme_color": "#222222",
"background_color": "#efefef",
"start_url": "/",
"display": "standalone",
"orientation": "portrait"
}
128 changes: 128 additions & 0 deletions public/sw.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions public/sw.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit fd0e464

Please sign in to comment.