webpacker-pwa

0.1.2 • Public • Published

webpacker-pwa npm package

  • Overrides default Webpacker configuration transparently
  • Compiles service workers directly in the public folder.
  • Allows to code service workers and use webpack-dev-server.
  • No changes are needed server-side
  • Works without Sprockets.

Usage

  1. Install the npm package:

bin/yarn add webpacker-wpa

  1. Edit config/webpack/environment.js:
const { resolve } = require('path');
const { config, environment, Environment } = require('@rails/webpacker');
const WebpackerPwa = require('webpacker-pwa');
new WebpackerPwa(config, environment);
module.exports = environment;
  1. Define the service workers folder in config/webpacker.yml

service_workers_entry_path: service_workers

Start writing your Progressive Rails App! 🎉

Compatibility

The package is doing a lot of changes on the default Webpacker configuration. If some configurations change on Webpacker, this package might need to be updated. The current version has been tested with Webpacker >= 4.0.

Readme

Keywords

Package Sidebar

Install

npm i webpacker-pwa

Weekly Downloads

1,228

Version

0.1.2

License

MIT

Unpacked Size

6.41 kB

Total Files

3

Last publish

Collaborators

  • coorasse