-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
refractor service worker #4123
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
refractor service worker #4123
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/webpack-docs/webpack-js-org/jz89vbgza |
Got a weird issue in CI https://travis-ci.org/github/webpack/webpack.js.org/jobs/741364115#L283:
Downgrading html-webpack-plugin fixed the problem. |
b51ccb5
to
17c7af5
Compare
@@ -57,7 +57,7 @@ | |||
"jest": "jest", | |||
"cypress:open": "cypress open", | |||
"cypress:run": "cypress run", | |||
"cypress:ci": "start-server-and-test http-get://localhost:3000 cypress:run" | |||
"cypress:ci": "start-server-and-test build-test http://localhost:4200 cypress:run" |
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.
We're testing against the production site now, I think it makes more sense than testing against development site.
8cd2b3c
to
9cd85e6
Compare
Oops, we have a problem GoogleChrome/workbox#2493 now:
|
const { Compilation, sources } = require('webpack'); | ||
const getManifestEntriesFromCompilation = require('workbox-webpack-plugin/build/lib/get-manifest-entries-from-compilation'); | ||
|
||
module.exports = class PrecacheSsgManifestPlugin { |
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.
Please move this to an external dependency.
We have
webpack.ssg.js
to generate those static html pages, but the current service worker is not taking full advantage of them.For example, when we open
view-source:https://webpack.js.org/guides/
, we expectdist/guides/index.html
to be returned. Instead/app-shell/index.html
is returned at the moment.This pull request refractors the service worker replacing
GenerateSW
withInjectManifest
which gives us more control.