@io-arc/task-service-worker
Create a Service Worker
Last updated 2 months ago by arcone .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @io-arc/task-service-worker 
SYNC missed versions from official npm registry.

@io-arc/task-service-worker

Create a Service Worker.

Usage

$ NODE_ENV=development ia-sw

* There's no watch mode.

Execute src/sw.js if it exists.
It is created using generateSW of WorkBox.

sw.js

The minimum configuration required for execution.

// src/sw.js
module.exports = {
  manifest: {}
}

The globDirectory and swDest properties, which are required by WorkBox, are ignored even if they are specified because they are generated automatically.

Changing output file name

Default output file name is sw.js, but you can change the file name.

// src/sw.js
module.exports = {
  filename: 'foo.js',
  manifest: {}
}

// output 'path/dist/foo.js'

Manifest options

Take a look at WorkBox > generateSW

example

// src/sw.js
module.exports = {
  manifest: {
    ignoreURLParametersMatching: [/^utm_/],
    directoryIndex: 'index.html',
    globFollow: true,
    globIgnores: ['node_modules/**/*'],
    sourcemap: false
  }
}

Create a template

Command is $ ia-sw -t or $ ia-sw --template.
Create a sw.js underneath the src.

Current Tags

  • 0.2.5                                ...           latest (4 days ago)

10 Versions

  • 0.2.5                                ...           4 days ago
  • 0.2.4                                ...           4 days ago
  • 0.2.3                                ...           9 days ago
  • 0.2.2                                ...           17 days ago
  • 0.2.1                                ...           21 days ago
  • 0.2.0                                ...           21 days ago
  • 0.1.1                                ...           a month ago
  • 0.1.0                                ...           a month ago
  • 0.0.2                                ...           2 months ago
  • 0.0.1                                ...           2 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 26
Last Day 0
Last Week 17
Last Month 44
Dependencies (9)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |