From 8ef5a5483d93bd03cbd589cf2aee56e0a37d8fd8 Mon Sep 17 00:00:00 2001 From: Jeff Avallone Date: Thu, 29 Mar 2018 21:25:45 -0400 Subject: [PATCH] Upgrading Workbox plugin --- package.json | 2 +- webpack.prod.js | 4 +- yarn.lock | 147 +++++++++++++++++++++++++++++++++++++++--------- 3 files changed, 123 insertions(+), 30 deletions(-) diff --git a/package.json b/package.json index 7492ade..3d4938c 100644 --- a/package.json +++ b/package.json @@ -165,7 +165,7 @@ "webpack-cli": "^2.0.9", "webpack-merge": "^4.1.1", "webpack-node-externals": "^1.6.0", - "workbox-webpack-plugin": "^2.1.2" + "workbox-webpack-plugin": "^3.0.1" }, "devDependencies": { "http-server": "^0.11.1", diff --git a/webpack.prod.js b/webpack.prod.js index 15d71f1..de38a43 100644 --- a/webpack.prod.js +++ b/webpack.prod.js @@ -3,7 +3,7 @@ const webpack = require('webpack'); const merge = require('webpack-merge'); const common = require('./webpack.common.js'); const UglifyJSPlugin = require('uglifyjs-webpack-plugin'); -const WorkboxPlugin = require('workbox-webpack-plugin'); +const { GenerateSW } = require('workbox-webpack-plugin'); const nodeExternals = require('webpack-node-externals'); module.exports = [ @@ -15,7 +15,7 @@ module.exports = [ new UglifyJSPlugin({ sourceMap: true }), - new WorkboxPlugin({ + new GenerateSW({ clientsClaim: true, skipWaiting: true, runtimeCaching: [ diff --git a/yarn.lock b/yarn.lock index 2e583a0..112aa0f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1943,6 +1943,12 @@ commander@~2.13.0: version "2.13.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.13.0.tgz#6964bca67685df7c1f1430c584f07d7597885b9c" +common-tags@^1.4.0: + version "1.7.2" + resolved "https://registry.yarnpkg.com/common-tags/-/common-tags-1.7.2.tgz#24d9768c63d253a56ecff93845b44b4df1d52771" + dependencies: + babel-runtime "^6.26.0" + commondir@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" @@ -3441,12 +3447,12 @@ fs-extra@^1.0.0: jsonfile "^2.1.0" klaw "^1.0.0" -fs-extra@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-3.0.1.tgz#3794f378c58b342ea7dbbb23095109c4b3b62291" +fs-extra@^4.0.2: + version "4.0.3" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-4.0.3.tgz#0d852122e5bc5beb453fb028e9c0c9bf36340c94" dependencies: graceful-fs "^4.1.2" - jsonfile "^3.0.0" + jsonfile "^4.0.0" universalify "^0.1.0" fs-write-stream-atomic@^1.0.8: @@ -4575,6 +4581,12 @@ isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" +isemail@3.x.x: + version "3.1.1" + resolved "https://registry.yarnpkg.com/isemail/-/isemail-3.1.1.tgz#e8450fe78ff1b48347db599122adcd0668bd92b5" + dependencies: + punycode "2.x.x" + isexe@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" @@ -4973,6 +4985,14 @@ jimp@^0.2.13, jimp@^0.2.21: tinycolor2 "^1.1.2" url-regex "^3.0.0" +joi@^11.1.1: + version "11.4.0" + resolved "https://registry.yarnpkg.com/joi/-/joi-11.4.0.tgz#f674897537b625e9ac3d0b7e1604c828ad913ccb" + dependencies: + hoek "4.x.x" + isemail "3.x.x" + topo "2.x.x" + jpeg-js@^0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/jpeg-js/-/jpeg-js-0.1.2.tgz#135b992c0575c985cfa0f494a3227ed238583ece" @@ -5134,9 +5154,9 @@ jsonfile@^2.1.0: optionalDependencies: graceful-fs "^4.1.6" -jsonfile@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-3.0.1.tgz#a5ecc6f65f53f662c4415c7675a0331d0992ec66" +jsonfile@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" optionalDependencies: graceful-fs "^4.1.6" @@ -7197,14 +7217,14 @@ punycode@1.3.2: version "1.3.2" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" +punycode@2.x.x, punycode@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.0.tgz#5f863edc89b96db09074bad7947bf09056ca4e7d" + punycode@^1.2.4, punycode@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" -punycode@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.0.tgz#5f863edc89b96db09074bad7947bf09056ca4e7d" - q@^1.1.2: version "1.5.1" resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" @@ -8693,6 +8713,12 @@ to-regex@^3.0.1, to-regex@^3.0.2: regex-not "^1.0.2" safe-regex "^1.1.0" +topo@2.x.x: + version "2.0.2" + resolved "https://registry.yarnpkg.com/topo/-/topo-2.0.2.tgz#cd5615752539057c0dc0491a621c3bc6fbe1d182" + dependencies: + hoek "4.x.x" + toposort@^1.0.0: version "1.0.6" resolved "https://registry.yarnpkg.com/toposort/-/toposort-1.0.6.tgz#c31748e55d210effc00fdcdc7d6e68d7d7bb9cec" @@ -9315,26 +9341,93 @@ wordwrap@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" -workbox-build@^2.1.3: - version "2.1.3" - resolved "https://registry.yarnpkg.com/workbox-build/-/workbox-build-2.1.3.tgz#a8161946d3f85b8cc2590dd3a519d53d40ff8a06" +workbox-background-sync@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/workbox-background-sync/-/workbox-background-sync-3.0.1.tgz#4b265bb15b0f516f41d4442066090605fe1e134c" dependencies: - chalk "^1.1.3" - fs-extra "^3.0.1" - glob "^7.1.1" + workbox-core "^3.0.1" + +workbox-broadcast-cache-update@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/workbox-broadcast-cache-update/-/workbox-broadcast-cache-update-3.0.1.tgz#a1548fc93a7f010d9b4ee7955120779a7f8a4532" + dependencies: + workbox-core "^3.0.1" + +workbox-build@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/workbox-build/-/workbox-build-3.0.1.tgz#818679f4f95a36ac9d6c860f04f74936db56061b" + dependencies: + babel-runtime "^6.26.0" + common-tags "^1.4.0" + fs-extra "^4.0.2" + glob "^7.1.2" + joi "^11.1.1" lodash.template "^4.4.0" - mkdirp "^0.5.1" - workbox-sw "^2.1.3" + pretty-bytes "^4.0.2" + workbox-background-sync "^3.0.1" + workbox-broadcast-cache-update "^3.0.1" + workbox-cache-expiration "^3.0.1" + workbox-cacheable-response "^3.0.1" + workbox-core "^3.0.1" + workbox-google-analytics "^3.0.1" + workbox-precaching "^3.0.1" + workbox-routing "^3.0.1" + workbox-strategies "^3.0.1" + workbox-sw "^3.0.1" -workbox-sw@^2.1.3: - version "2.1.3" - resolved "https://registry.yarnpkg.com/workbox-sw/-/workbox-sw-2.1.3.tgz#4045560dc26ada7a41fe37999a93c71c43e41d6a" - -workbox-webpack-plugin@^2.1.2: - version "2.1.3" - resolved "https://registry.yarnpkg.com/workbox-webpack-plugin/-/workbox-webpack-plugin-2.1.3.tgz#e4de94818ccef6f667b1f5f418ce5a1061da8d33" +workbox-cache-expiration@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/workbox-cache-expiration/-/workbox-cache-expiration-3.0.1.tgz#0643cabb1aeabe5d63aa6e8f0ac16b579835b608" dependencies: - workbox-build "^2.1.3" + workbox-core "^3.0.1" + +workbox-cacheable-response@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/workbox-cacheable-response/-/workbox-cacheable-response-3.0.1.tgz#a1e3f8ad8a041b1379b1d25c5e2a14d79f322277" + dependencies: + workbox-core "^3.0.1" + +workbox-core@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/workbox-core/-/workbox-core-3.0.1.tgz#83c7c39fb4b71e1f1c1d67394431fb7362756863" + +workbox-google-analytics@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/workbox-google-analytics/-/workbox-google-analytics-3.0.1.tgz#693a4a8d2f534796b5af172af01132a9691bddb7" + dependencies: + workbox-background-sync "^3.0.1" + workbox-core "^3.0.1" + workbox-routing "^3.0.1" + workbox-strategies "^3.0.1" + +workbox-precaching@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/workbox-precaching/-/workbox-precaching-3.0.1.tgz#768b4dec2a6b22e8c58176aaadab0c4bb9dcdde2" + dependencies: + workbox-core "^3.0.1" + +workbox-routing@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/workbox-routing/-/workbox-routing-3.0.1.tgz#2784d8b0eb41de57bfb330b09336b60eb12505b2" + dependencies: + workbox-core "^3.0.1" + +workbox-strategies@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/workbox-strategies/-/workbox-strategies-3.0.1.tgz#c2dad35bfec71839087a8aba453282600c2cb4ab" + dependencies: + workbox-core "^3.0.1" + +workbox-sw@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/workbox-sw/-/workbox-sw-3.0.1.tgz#c030413809ab9d558949a691eb6428ab9d621e09" + +workbox-webpack-plugin@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/workbox-webpack-plugin/-/workbox-webpack-plugin-3.0.1.tgz#e7024eda8ea7c557d06d2e086d999b475b3da98a" + dependencies: + json-stable-stringify "^1.0.1" + workbox-build "^3.0.1" worker-farm@^1.5.2: version "1.6.0"