Created by: piotr-cz
This PR adds an ability to use importScripts
option of SWPrecacheWebpackPlugin
.
How-to:
- create a file called
public/service-worker-import.js
- run
npm run build
- check that file has been loaded (either in console network panel or by placing console.log statement inside and checking for output) by refreshing the page
File is being imported only on service worker install/ update.
Downsides:
- It's possible to import only one file and it's name is harcoded
- File is not being passed trough plugins (minification, etc)
Fixes: #2253 (closed)