Security News
How Threat Actors are Abusing GitHub’s File Upload Feature to Host Malware
GitHub is susceptible to a CDN flaw that allows attackers to host malware on any public repository.
next-workbox-webpack-plugin
Advanced tools
Readme
Webpack plugin with workbox, it helps you build a Progressive Web App powered by Next.js. Generating service worker scripts and precache manifest of Next.js's pages and chunks.
$ npm install -d next-workbox-webpack-plugin
const nextWorkboxWebpackPlugin = require('next-workbox-webpack-plugin');
nextWorkboxWebpackPlugin({
// must, see next.config.js below
buildId,
// optional, next.js dist path as compiling. most of cases you don't need to fix it.
distDir: '.next',
// optional, which version of workbox will be used in between 'local' or 'cdn'. 'local'
// option will help you use copy of workbox libs in localhost.
importWorkboxFrom: 'local',
// optional ,whether make a precache manifest of pages and chunks of Next.js app or not.
precacheManifest: true,
// optional, whether delete workbox path generated by the plugin.
removeDir: true,
// optional, path for generating sw files in build, `./static/workbox` is default
swDestRoot: './static/',
// optional, path for serving sw files in build, `./static/workbox` is default
swURLRoot: '/static'
// optional, you can use workbox-build options. except swDest because of output location is fixed in 'static/workbox',
...WorkboxBuildOptions,
});
const NextWorkboxWebpackPlugin = require('next-workbox-webpack-plugin');
module.exports = {
webpack: (config, {isServer, dev, buildId, config: {distDir}}) => {
if (!isServer && !dev) {
config.plugins.push(new NextWorkboxWebpackPlugin({
distDir,
buildId
}))
}
return config
}
}
NOT dev mode
. You can't test with next
and next start
sw.js
, you need custom server with custom route. See test server is in this package./static/workbox
because of exporting. You might need to add the path to gitignore.static/workbox
├── next-precache-manifest-d42167a04499e1887dad3156b93e064d.js
├── sw.js
└── workbox-v3.0.0-beta.0
├── workbox-background-sync.dev.js
├── ...
├── workbox-sw.js
[TBD]
MIT © Jimmy Moon
FAQs
Webpack plugin for next with workbox
The npm package next-workbox-webpack-plugin receives a total of 33 weekly downloads. As such, next-workbox-webpack-plugin popularity was classified as not popular.
We found that next-workbox-webpack-plugin 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.
Security News
GitHub is susceptible to a CDN flaw that allows attackers to host malware on any public repository.
Security News
At Node Congress, Socket CEO Feross Aboukhadijeh uncovers the darker aspects of open source, where applications that rely heavily on third-party dependencies can be exploited in supply chain attacks.
Research
Security News
The Socket Research team found this npm package includes code for collecting sensitive developer information, including your operating system username, Git username, and Git email.