@@ -14,10 +14,10 @@ module.exports = function nuxtManifest (options) {
14
14
this . nuxt . hook ( 'build:before' , hook )
15
15
}
16
16
17
- function addManifest ( options ) {
17
+ function addManifest ( _options ) {
18
18
const { routerBase, publicPath } = getRouteParams ( this . options )
19
19
20
- // Defaults
20
+ // Combine sources
21
21
const defaults = {
22
22
name : process . env . npm_package_name ,
23
23
short_name : process . env . npm_package_name ,
@@ -30,10 +30,12 @@ function addManifest (options) {
30
30
theme_color : this . options . loading && this . options . loading . color ,
31
31
lang : 'en'
32
32
}
33
+ const options = { ...defaults , ...this . options . manifest , ..._options }
33
34
34
- // Combine sources
35
- const manifest = Object . assign ( { } , defaults , this . options . manifest , options )
35
+ // Remve extra fields from manifest
36
+ const manifest = { ... options }
36
37
delete manifest . src
38
+ delete manifest . publicPath
37
39
38
40
// Stringify manifest & generate hash
39
41
const manifestSource = JSON . stringify ( manifest )
@@ -59,7 +61,7 @@ function addManifest (options) {
59
61
60
62
// Add manifest meta
61
63
if ( ! find ( this . options . head . link , 'rel' , 'manifest' ) ) {
62
- const baseAttribute = { rel : 'manifest' , href : joinUrl ( manifest . publicPath , manifestFileName ) }
64
+ const baseAttribute = { rel : 'manifest' , href : joinUrl ( options . publicPath , manifestFileName ) }
63
65
const attribute = manifest . crossorigin ? Object . assign ( { } , baseAttribute , { crossorigin : manifest . crossorigin } ) : baseAttribute
64
66
this . options . head . link . push ( attribute )
65
67
} else {
0 commit comments