https://github.com/extrawest/service-worker-generator
Utility tool to allow generate service-worker with env variables
https://github.com/extrawest/service-worker-generator
Last synced: 9 months ago
JSON representation
Utility tool to allow generate service-worker with env variables
- Host: GitHub
- URL: https://github.com/extrawest/service-worker-generator
- Owner: extrawest
- License: bsd-2-clause
- Created: 2021-07-26T18:54:36.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-07-27T11:22:49.000Z (almost 5 years ago)
- Last Synced: 2025-08-08T16:28:54.416Z (10 months ago)
- Language: JavaScript
- Size: 93.8 KB
- Stars: 7
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

[](https://github.com/extrawest/service-worker-generator/graphs/commit-activity)

[](https://github.com/extrawest/service-worker-generator/tags/)
# Extrawest Service Worker Generator
Utility tool to allow generate service-worker with env variables
## Installation
Extrawest Service Worker Generator compatible with webpack5
```bash
# with npm
npm install --save @extrawest/service-worker-generator
# with yarn
yarn add @extrawest/service-worker-generator
```
## Usage
$ generateSW [options] ``
## Options
| Command | Description |
| ----------------- |---------------------------------------------|
| -e, --env [path] | (./.env) Path to environment variables file |
| -o, --output-path [path] | path of build artifacts [./build] |
| -h, --help | Output usage information |
| -m, --mode [mode] | Output mode (dev or build) |
## Example
```
"build-sw": "generateSW --mode=build --env ./.env ./libs/sw/firebase-messaging-sw.js --output-path ./public",
```
## License
- See [LICENSE](/LICENSE)
---
Created by Extrawest React.js Team
[Extrawest.com](https://www.extrawest.com), 2021
---