welcome.mjs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. Copyright 2019 Google LLC
  3. Use of this source code is governed by an MIT-style
  4. license that can be found in the LICENSE file or at
  5. https://opensource.org/licenses/MIT.
  6. */
  7. import {checkSWFileCacheHeaders} from './_private/checkSWFileCacheHeaders.mjs';
  8. import {logger} from '../_private/logger.mjs';
  9. import '../_version.mjs';
  10. // A WorkboxCore instance must be exported before we can use the logger.
  11. // This is so it can get the current log level.
  12. if (process.env.NODE_ENV !== 'production') {
  13. const padding = ' ';
  14. logger.groupCollapsed('Welcome to Workbox!');
  15. logger.log(`You are currently using a development build. ` +
  16. `By default this will switch to prod builds when not on localhost. ` +
  17. `You can force this with workbox.setConfig({debug: true|false}).`);
  18. logger.log(
  19. `📖 Read the guides and documentation\n` +
  20. `${padding}https://developers.google.com/web/tools/workbox/`
  21. );
  22. logger.log(
  23. `❓ Use the [workbox] tag on Stack Overflow to ask questions\n` +
  24. `${padding}https://stackoverflow.com/questions/ask?tags=workbox`
  25. );
  26. logger.log(
  27. `🐛 Found a bug? Report it on GitHub\n` +
  28. `${padding}https://github.com/GoogleChrome/workbox/issues/new`
  29. );
  30. logger.groupEnd();
  31. if (typeof checkSWFileCacheHeaders === 'function') {
  32. checkSWFileCacheHeaders();
  33. }
  34. }