8000 Added serviceworker and web-manifest by lucacasonato · Pull Request #154 · coder/code-server · GitHub
[go: up one dir, main page]

Skip to content

Added serviceworker and web-manifest #154

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

Merged
merged 19 commits into from
Apr 16, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
moved the service worker back into prod only
  • Loading branch information
lucacasonato committed Apr 14, 2019
commit ade46ee64c7618bb943e5758967151baf844faf4
35 changes: 34 additions & 1 deletion scripts/webpack.client.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,39 @@ module.exports = (options = {}) => merge(
}*/
]
})
].concat(prod ? [] : [new webpack.HotModuleReplacementPlugin()]),
].concat(prod ? [
new GenerateSW({
runtimeCaching: [
{
urlPattern: new RegExp(".*"),
handler: "StaleWhileRevalidate",
options: {
cacheName: "code-server",
expiration: {
maxAgeSeconds: 86400
},
cacheableResponse: {
statuses: [0, 200]
}
}
}
// Network first caching is also possible.
/*{
urlPattern: "",
handler: "NetworkFirst",
options: {
networkTimeoutSeconds: 4,
cacheName: "code-server",
expiration: {
maxAgeSeconds: 86400,
},
cacheableResponse: {
statuses: [0, 200],
},
},
}*/
]
})
] : [new webpack.HotModuleReplacementPlugin()]),
target: "web"
});
0