gulp-workbox
TypeScript icon, indicating that this package has built-in type declarations

1.0.6 • Public • Published

gulp-workbox

Gulp plugin for injecting workbox manifest.

This plugin is especially useful if you need to build the sw.js first (perhaps by TypeScript) and then inject the manifest in a single flow.

License

MIT © Mu-Tsun Tsai 2021

Install

npm install workbox-build gulp-workbox -save-dev

Notice that workbox-build is deliberately installed separately.

Usage

var gulp = require('gulp');
var workbox = require('gulp-workbox');

gulp.task('build', () =>
	gulp.src('src/sw.js')
		.pipe(workbox({
			globDirectory: 'dist',
			globPatterns: [
				'**/*.htm',
				'**/*.js',
				'**/*.css',
			],
			globIgnores: ['sw.js']
		}))
		.pipe(gulp.dest('dist'))
);

The options are the same as those of the getManifest() method, plus an optional string injectionPoint (whose default value is "self.__WB_MANIFEST");

Readme

Keywords

none

Package Sidebar

Install

npm i gulp-workbox

Weekly Downloads

2

Version

1.0.6

License

MIT

Unpacked Size

3.58 kB

Total Files

5

Last publish

Collaborators

  • mutsuntsai