UNPKG

ember-web-app

Version:

This Ember addon helps you configure and manage the Web App Manifest to create a Progressive Web App

21 lines (18 loc) 454 B
'use strict'; const hasTarget = require('../utils/has-target'); const { link } = require('../utils/tag-builder'); module.exports = function favicon(manifest) { if (!manifest.icons || !manifest.icons.length) { return []; } return manifest.icons .filter((icon) => hasTarget(icon, 'favicon')) .map((icon) => link({ rel: 'icon', href: icon.src, sizes: icon.sizes, type: icon.type, }) ); };