From 3709a87b782321edacf67e872e805bcb4d1eabdd Mon Sep 17 00:00:00 2001 From: Hiroki Yoshitsugu Date: Fri, 6 Jul 2018 14:33:22 +0900 Subject: [PATCH] feat: add new attribute to link tag for manifest.json --- packages/manifest/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/manifest/index.js b/packages/manifest/index.js index 5be15d1d..c334df6a 100755 --- a/packages/manifest/index.js +++ b/packages/manifest/index.js @@ -72,7 +72,9 @@ function addManifest (options) { // Add manifest meta if (!find(this.options.head.link, 'rel', 'manifest')) { - this.options.head.link.push({ rel: 'manifest', href: fixUrl(`${manifest.publicPath}/${manifestFileName}`) }) + const baseAttribute = { rel: 'manifest', href: fixUrl(`${manifest.publicPath}/${manifestFileName}`) } + const attribute = manifest.crossorigin ? Object.assign({}, baseAttribute, { crossorigin: manifest.crossorigin }) : baseAttribute + this.options.head.link.push(attribute) } else { console.warn('Manifest meta already provided!') }