diff --git a/lib/tags.js b/lib/tags.js index ff03453a..d752c760 100644 --- a/lib/tags.js +++ b/lib/tags.js @@ -152,7 +152,10 @@ function getNecessaryScripts (tags, cdnBase = 'https://cdn.ampproject.org/v0/', const detectedTags = Object.keys(tags) .filter(tag => filterTag(html, tag, tags[tag])) .map(tag => generateScript(cdnBase, tag, tags[tag])) - return detectedTags.join('') + + const distinctDetectedTags = [...new Set(detectedTags)] + + return distinctDetectedTags.join('') } module.exports = {