File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
packages/@vue/cli-plugin-pwa Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change 1+ const fs = require ( 'fs' )
2+ const { chalk, warn } = require ( '@vue/cli-shared-utils' )
3+
14module . exports = ( api , options ) => {
5+ const userOptions = options . pwa || { }
6+
7+ const manifestPath = api . resolve ( 'public/manifest.json' )
8+ if ( fs . existsSync ( manifestPath ) ) {
9+ if ( ! userOptions . manifestOptions ) {
10+ userOptions . manifestOptions = require ( manifestPath )
11+ } else {
12+ warn (
13+ `The ${ chalk . red ( 'public/manifest.json' ) } file will be ignored in favor of ${ chalk . cyan ( 'pwa.manifestOptions' ) } `
14+ )
15+ }
16+ }
17+
218 api . chainWebpack ( webpackConfig => {
319 const target = process . env . VUE_CLI_BUILD_TARGET
420 if ( target && target !== 'app' ) {
521 return
622 }
723
824 const name = api . service . pkg . name
9- const userOptions = options . pwa || { }
1025
1126 // the pwa plugin hooks on to html-webpack-plugin
1227 // and injects icons, manifest links & other PWA related tags into <head>
You can’t perform that action at this time.
0 commit comments