Skip to content

Commit

Permalink
Revert "refactor: move cachingExtensions to runtime caching section"
Browse files Browse the repository at this point in the history
This reverts commit 732602b.
  • Loading branch information
pooya parsa committed Feb 7, 2019
1 parent 9f34d27 commit 58c972f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/workbox/templates/sw.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,15 @@ workbox.precaching.precacheAndRoute([<%= options.offlineAssets.map((i) => `'${i}
workbox.precaching.precacheAndRoute(['<%= options.offlinePage %>'])
<% } %>

// --------------------------------------------------
// Runtime Caching
// --------------------------------------------------
<% if (options.cachingExtensions) { %>
// -- Start of cachingExtensions --
<%= options.cachingExtensions %>// -- End of cachingExtensions --
<% } %>

// --------------------------------------------------
// Runtime Caching
// --------------------------------------------------

// Register route handlers for runtimeCaching
<% options.runtimeCaching.forEach(r => { %>workbox.routing.registerRoute(new RegExp('<%= r.urlPattern %>'), workbox.strategies.<%= r.handler %> (<%= JSON.stringify(r.strategyOptions || {}) %>), '<%= r.method %>')
<% }) %>
Expand Down

0 comments on commit 58c972f

Please sign in to comment.