Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mutsuntsai/gulp-workbox
https://github.com/mutsuntsai/gulp-workbox
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/mutsuntsai/gulp-workbox
- Owner: MuTsunTsai
- License: mit
- Created: 2021-01-15T03:28:08.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-06-01T08:52:27.000Z (over 1 year ago)
- Last Synced: 2024-10-31T18:28:09.576Z (2 months ago)
- Language: TypeScript
- Size: 222 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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
```bash
npm install workbox-build gulp-workbox -save-dev
```Notice that [workbox-build](https://www.npmjs.com/package/workbox-build) is deliberately installed separately.
## Usage
```javascript
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()`](https://developers.google.com/web/tools/workbox/reference-docs/latest/module-workbox-build#.getManifest) method, plus an optional string `injectionPoint` (whose default value is `"self.__WB_MANIFEST"`);