Created
August 7, 2018 00:21
-
-
Save kevinah95/0d2985c879ee4e4d9951835841933655 to your computer and use it in GitHub Desktop.
registerServiceWorker.js for Using Workbox with Create React App (Without Ejecting) Medium
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export default function register() { | |
| // Some validations here | |
| window.addEventListener('load', () => { | |
| const swUrl = `${process.env.PUBLIC_URL}/custom-sw.js`; // In this line | |
| ... | |
| } | |
| // Another stuffs here | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment