fix: pwa plugin should be ignored when target is not app

close #1497
This commit is contained in:
Evan You
2018-06-07 10:12:22 -04:00
parent 7d06f09425
commit 85e6e5ea6c
2 changed files with 6 additions and 2 deletions
+5
View File
@@ -1,5 +1,10 @@
module.exports = (api, options) => {
api.chainWebpack(webpackConfig => {
const target = process.env.VUE_CLI_BUILD_TARGET
if (target && target !== 'app') {
return
}
const name = api.service.pkg.name
const userOptions = options.pwa || {}
+1 -2
View File
@@ -194,10 +194,9 @@ module.exports = class Service {
// check if the user has manually mutated output.publicPath
const target = process.env.VUE_CLI_BUILD_TARGET
const exceptionTargets = ['lib', 'wc', 'wc-async']
if (
!process.env.VUE_CLI_TEST &&
!exceptionTargets.includes(target) &&
(target && target !== 'app') &&
config.output.publicPath !== this.projectOptions.baseUrl
) {
throw new Error(