Skip to content

Commit

Permalink
fix(pwa): set cacheid in GenerateSW mode only (#939)
Browse files Browse the repository at this point in the history
close #891
  • Loading branch information
umarov authored and yyx990803 committed Mar 4, 2018
1 parent a2ac6be commit 43971d8
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions packages/@vue/cli-plugin-pwa/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,20 @@ module.exports = (api, options) => {
)
}

const workBoxConfig = Object.assign({
cacheId: name,
const defaultOptions = {
exclude: [
/\.map$/,
/img\/icons\//,
/favicon\.ico$/,
/manifest\.json$/
]
}, userOptions.workboxOptions)
}

const defaultGenerateSWOptions = workboxPluginMode === 'GenerateSW' ? {
cacheId: name
} : {}

const workBoxConfig = Object.assign(defaultOptions, defaultGenerateSWOptions, userOptions.workboxOptions)

webpackConfig
.plugin('workbox')
Expand Down

0 comments on commit 43971d8

Please sign in to comment.