-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generate manifest from original. Better export. #59
Conversation
Woah! You beat me to it 🔥 I had a WIP but wasn't totally happy with it: https://github.com/hanford/next-offline/tree/export-rewrite I'll review this today! |
I actually thought about mentioning it. But it really just started with the #49, then I got carried away.. 😆But do let me know if you prefer things in any other way! No rush for the review. I forgot to change the next requirements in package.json. Doing it now. |
ahh, @joaovieira will we need to make make the major improvement to the codebase IMO 🍾🍻 |
Just did. Yes. That new |
{ | ||
"printWidth": 100, | ||
"trailingComma": "all", | ||
"singleQuote": true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
put some defaults that I use personally. the only difference I think was the trailingComma
option. what do you prefer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing makes sense
"prettier": "^1.14.2", | ||
"pretty-quick": "^1.6.0" | ||
"prettier": "^1.14.3", | ||
"pretty-quick": "^1.7.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove unused ones and updated all packages
"workbox-webpack-plugin": "^3.5.0" | ||
"fs-extra": "~7.0.0", | ||
"glob": "~7.1.3", | ||
"webpack": "^4.19.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still required by workbox plugin even though it's not a peer dependency 😩
Thanks again ❤️ |
Live in 3.0.0 🔥🎉 |
Luckily the Next 7 builds everything inside
/static
so the previous version just works 🎉This PR refactors the logic as discussed in #49 to read the workbox-generated precache manifest instead of generating one from scratch. This should be more reliable moving forward, in case Next.js updates their paths.
On top of that I've made the export functionality using the new
exportPathMap
options which simplifies massively. #23Finally, I've removed the hard-coded service-worker.js to use
workboxOpts.swDest
everywhere. #45This is not compatible with next@6 so it requires a major bump.
Fixes #49.
Fixes #23.
Fixes #45.