Skip to content

Commit

Permalink
Remove debug stuff.
Browse files Browse the repository at this point in the history
  • Loading branch information
lbogdan committed May 31, 2019
1 parent a376cc2 commit a83f01e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
7 changes: 1 addition & 6 deletions packages/app/config/webpack.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,7 @@ module.exports = merge(commonConfig, {
stats: 'verbose',

optimization: {
minimizer: [
new TerserJSPlugin({
parallel: true,
sourceMap: true,
}),
],
minimizer: [new TerserJSPlugin({ parallel: true })],
concatenateModules: true, // ModuleConcatenationPlugin
namedModules: true, // NamedModulesPlugin()
noEmitOnErrors: true, // NoEmitOnErrorsPlugin
Expand Down
7 changes: 0 additions & 7 deletions packages/common/src/registerServiceWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,11 @@ export default function register(swUrl, { onUpdated, onInstalled }) {
}

// window.addEventListener('load', () => {
console.log('isLocalHost:', isLocalhost, 'isHttp:', isHttp);
if (!isLocalhost && !isHttp) {
// It's neither localhost nor http. Just register service worker
console.warn('registerValidSW', swUrl);
registerValidSW(swUrl, { onUpdated, onInstalled });
} else if (isLocalhost) {
// This is running on localhost. Lets check if a service worker still exists or not.
console.log('checkValidServiceWorker');
checkValidServiceWorker(swUrl, { onUpdated, onInstalled });
}
// });
Expand All @@ -57,14 +54,10 @@ function registerValidSW(
navigator.serviceWorker
.register(swUrl)
.then(registration => {
console.log('registration:', registration);
registration.onupdatefound = () => {
const installingWorker = registration.installing;
console.log('onupdatefound', registration);
installingWorker.onstatechange = () => {
console.log('onstatechange', installingWorker);
if (installingWorker.state === 'installed') {
console.log('installed', navigator.serviceWorker);
if (navigator.serviceWorker.controller) {
// At this point, the old content will have been purged and
// the fresh content will have been added to the cache.
Expand Down

0 comments on commit a83f01e

Please sign in to comment.