0.3.1 • Published 6 years ago

serviceworker-webpack-plugin-martiuh v0.3.1

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

serviceworker-webpack-plugin

Simplifies creation of a service worker to serve your webpack bundles.

Installation

npm i serviceworker-webpack-plugin-martiuh

It's only compatible with webpack 1, 2, and 3

The simple truth

First of all, this a simple fork, it only adds a feature necessary for a project I'm doing, which is scriptURL it can now be set manually and the service worker will try to be installed from that specific directory. All the work is to oliviertassinari and the amazing serviceworker-webpack-plugin

API

ServiceWorkerWebpackPlugin(options)

  • options
  • entry, required, string: Path to the actual service worker implementation.
  • filename, string, default 'sw.js': Relative (from the webpack's config output.path) output path for emitted script.
  • excludes, array, default ['**/.*', '**/*.map']: Exclude matched assets from being added to the serviceWorkerOption.assets variable. (Blacklist)
  • includes, array, default ['**/*']: Include matched assets added to the serviceWorkerOption.assets variable. (Whitelist)
  • publicPath, string, default '/': Specifies the public URL address of the output files when referenced in a browser.
  • outputDir: If you want your serviceWorker file to be stored in a aditional folder inside webpack's output path.
  • template, function, default noop: This callback function can be used to inject statically generated service worker. It's taking a serviceWorkerOption argument and must return a promise.
  • transformOptions, function: The jsonStats key contains all the webpack build information.

runtime(options)

Credit

The specs

License

MIT

0.3.1

6 years ago

0.3.0

6 years ago

0.2.9

6 years ago

0.2.8

6 years ago

0.2.7

6 years ago

0.2.6

6 years ago

0.2.5

6 years ago

0.2.4

6 years ago