From 6b605fb31494a469a03283d87e70fcd848641ffa Mon Sep 17 00:00:00 2001 From: Ade Viankakrisna Fadlil Date: Thu, 4 Jan 2018 12:37:03 +0700 Subject: [PATCH] add log message for service worker doc --- .../react-scripts/template/src/registerServiceWorker.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/react-scripts/template/src/registerServiceWorker.js b/packages/react-scripts/template/src/registerServiceWorker.js index a3e6c0cfc10..a683208acbe 100644 --- a/packages/react-scripts/template/src/registerServiceWorker.js +++ b/packages/react-scripts/template/src/registerServiceWorker.js @@ -19,6 +19,12 @@ const isLocalhost = Boolean( ); export default function register() { + if (process.env.NODE_ENV !== 'production') { + console.log( + 'This project is configured to add a service worker caching in the production build. Read more on %o', + 'http://bit.ly/2vJdu84' + ); + } if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) { // The URL constructor is available in all browsers that support SW. const publicUrl = new URL(process.env.PUBLIC_URL, window.location);