File tree 1 file changed +16
-1
lines changed
packages/@vue/cli-plugin-pwa 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
+
1
4
module . 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
+
2
18
api . chainWebpack ( webpackConfig => {
3
19
const target = process . env . VUE_CLI_BUILD_TARGET
4
20
if ( target && target !== 'app' ) {
5
21
return
6
22
}
7
23
8
24
const name = api . service . pkg . name
9
- const userOptions = options . pwa || { }
10
25
11
26
// the pwa plugin hooks on to html-webpack-plugin
12
27
// and injects icons, manifest links & other PWA related tags into <head>
You can’t perform that action at this time.
0 commit comments