Skip to content

Commit b03dc14

Browse files
author
pooya parsa
committed
fix(manifest): remove publicPath field
1 parent 945d2e9 commit b03dc14

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

packages/manifest/index.js

+7-5
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ module.exports = function nuxtManifest (options) {
1414
this.nuxt.hook('build:before', hook)
1515
}
1616

17-
function addManifest (options) {
17+
function addManifest (_options) {
1818
const { routerBase, publicPath } = getRouteParams(this.options)
1919

20-
// Defaults
20+
// Combine sources
2121
const defaults = {
2222
name: process.env.npm_package_name,
2323
short_name: process.env.npm_package_name,
@@ -30,10 +30,12 @@ function addManifest (options) {
3030
theme_color: this.options.loading && this.options.loading.color,
3131
lang: 'en'
3232
}
33+
const options = { ...defaults, ...this.options.manifest, ..._options }
3334

34-
// Combine sources
35-
const manifest = Object.assign({}, defaults, this.options.manifest, options)
35+
// Remve extra fields from manifest
36+
const manifest = { ...options }
3637
delete manifest.src
38+
delete manifest.publicPath
3739

3840
// Stringify manifest & generate hash
3941
const manifestSource = JSON.stringify(manifest)
@@ -59,7 +61,7 @@ function addManifest (options) {
5961

6062
// Add manifest meta
6163
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) }
6365
const attribute = manifest.crossorigin ? Object.assign({}, baseAttribute, { crossorigin: manifest.crossorigin }) : baseAttribute
6466
this.options.head.link.push(attribute)
6567
} else {

0 commit comments

Comments
 (0)