
Product
Introducing Pull Request Stories to Help Security Teams Track Supply Chain Risks
Socket’s new Pull Request Stories give security teams clear visibility into dependency risks and outcomes across scanned pull requests.
gitbook-plugin-workbox
Advanced tools
A plugin for Gitbook that generates a service worker By using Workbox
This plugin uses Workbox - a module written by Google - to automatically generate a service worker and include it in your gitbook output.
Add this to your gitbook by including it in your book.json file.
{
"plugins": ["workbox"]
}
Be sure to run gitbook install
before building your book, or as part of your automated build process.
Create workbox-config.js
in the root directory (Maybe there is a package.json in the root directory)
Like the following.
module.exports = {
cacheId: "hoge",
globPatterns: [
"**/*.{html,js,css}"
],
clientsClaim: true,
runtimeCaching: [
{
urlPattern: /\.(jpg|png|svg|gif|woff|ttf|eot)/,
handler: "cacheFirst",
options: {
cacheName: "assets",
expiration: {
maxAgeSeconds: 60 * 60 * 24 * 14
}
}
},
],
};
This plugin already set globDirectory
and swDest
.
(Confirm index.js)
{
globDirectory: "_book",
swDest: "_book/service-worker.js",
}
So, if you overwrite this setting, please add your original setting in workbox-config.js
This plugin is released under the MIT License, please see LICENSE.
FAQs
A plugin for Gitbook that generates a service worker By using Workbox
We found that gitbook-plugin-workbox demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket’s new Pull Request Stories give security teams clear visibility into dependency risks and outcomes across scanned pull requests.
Research
/Security News
npm author Qix’s account was compromised, with malicious versions of popular packages like chalk-template, color-convert, and strip-ansi published.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.