
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
@siteone/builder-plugin-sw-precache
Advanced tools
> plugin for [SW Precache](https://github.com/GoogleChromeLabs/sw-precache)
plugin for SW Precache
$ npm install --save-dev @siteone/builder-plugin-sw-precache
The plugin is recognized by and attached to @siteone/builder-core automatically.
However, you must manually include the generated sw.js file into your bundle!
if (process.env.NODE_ENV === 'production') {
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('/sw.js');
}
}
Note: For SW beginners, it's strongly recommended you use the above snippet!
However, it's not required to wrap registration in aNODE_ENV === 'production'check.
Configurable via the precache key on your bldr.config.js file.
Default Config:
exports.precache = {
minify: true,
filename: 'sw.js',
// stripPrefix: env.src
navigateFallback: 'index.html',
navigateFallbackWhitelist: [/^(?!\/__).*/],
staticFileGlobsIgnorePatterns: [
/\.git/,
/\.DS_Store/,
/^manifest.*\.js(?:on)?$/,
/\.gz(ip)?$/,
/\.map$/,
/\.br$/
]
}
Available Options:
See Options for sw-precache-webpack-plugin.
FAQs
> plugin for [SW Precache](https://github.com/GoogleChromeLabs/sw-precache)
We found that @siteone/builder-plugin-sw-precache demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.