Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
grunt-sw-precache
Advanced tools
A Grunt task for generating service workers using sw-precache.
grunt-sw-precache requires Grunt ~0.4.5
.
If you haven't used Grunt before, please view the Getting Started guide. The guide explains how to create a Gruntfile, and how to install and use Grunt plugins.
grunt-sw-precache can be installed using the following command:
$ npm install grunt-sw-precache --save-dev
To enable grunt-sw-precache, add the following line to your Gruntfile
:
grunt.loadNpmTasks('grunt-sw-precache');
The options documented here are specific to grunt-sw-precache.
For all other options, please view the options documentation for sw-precache.
string
The base directory for the staticFileGlobs
and workerFileName
options.
Default is "./dist"
;
string
The file name of the generated service worker. This is joined with the baseDir
option.
Default is "service-worker.js"
;
boolean
If true
, a comment containing a human readable UTC timestamp will be appended to the service worker.
/* @preserve Thu, 01 Jan 1970 00:00:00 GMT */
Default is true
;
string
The same option as stripPrefix
in sw-precache, but has a different default value.
Default is baseDir + '/'
;
grunt.initConfig({
'sw-precache': {
options: {
cacheId: 'your-package-name',
workerFileName: 'sw.js',
verbose: true,
},
'default': {
staticFileGlobs: [
'css/**/*.css',
'font/**/*.{woff,ttf,svg,eot}',
'img/**/*.{gif,png,jpg}',
'js/**/*.js',
],
},
'develop': {
staticFileGlobs: [
'font/**/*.{woff,ttf,svg,eot}'
],
},
},
});
Released under the MIT license.
FAQs
A Grunt task for generating service workers using sw-precache.
The npm package grunt-sw-precache receives a total of 49 weekly downloads. As such, grunt-sw-precache popularity was classified as not popular.
We found that grunt-sw-precache 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
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.