selveq / service-worker
Magento 2 Service Worker extension for ScandiPWA theme
Package info
github.com/sellveq/service-worker
Type:magento2-module
pkg:composer/selveq/service-worker
Requires
- php: ^8.3
- magento/framework: ^103.0
- selveq/route717: ^3.0
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
This package is not auto-updated.
Last update: 2026-09-19 19:47:20 UTC
README
Fork of scandipwa/service-worker 1.0.3, maintained by Selveq for Magento 2.4.9 and PHP 8.3. Module name and namespace are unchanged, and the package replaces scandipwa/service-worker at every version, so it installs as a drop-in replacement. Selveq is not affiliated with or endorsed by Scandiweb.
What it does
- Answers
/service-worker.jswith the theme's built worker, read frompub/staticonce it is deployed and from the theme's ownMagento_Theme/web/service-worker.jsotherwise, withService-Worker-Allowed: /so the worker may control the whole origin. - Keeps the ScandiPWA router off that one path, so the request is answered with the script rather than the app shell.
- Answers 404 when the active theme ships no worker, and 405 to any method but GET and HEAD.
Install
composer require selveq/service-worker bin/magento setup:upgrade
The theme must ship Magento_Theme/web/service-worker.js, which the ScandiPWA theme does.
License
OSL-3.0, the license of the original work. Scandiweb's copyright notices are kept in every file, and each file Selveq changed carries a Modifications © Selveq notice.