Skip to content

Commit f240887

Browse files
committed
consolidate code in promote-favicon-to-root extension
1 parent 808744b commit f240887

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

ext/promote-favicon-to-root.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@ module.exports.register = function () {
44
this.once('uiLoaded', ({ siteCatalog, uiCatalog }) => {
55
const favicon = uiCatalog.findByType('asset').find((it) => it.path === 'img/favicon.ico')
66
if (!favicon) return
7-
const rootFavicon = new favicon.constructor({
7+
uiCatalog.addFile(new favicon.constructor({
88
contents: favicon.contents,
99
out: { dirname: '', basename: 'favicon.ico', path: 'favicon.ico' },
1010
path: 'favicon.ico',
1111
stat: favicon.stat,
1212
type: 'static',
13-
})
14-
uiCatalog.addFile(rootFavicon)
13+
}))
1514
})
1615
}

0 commit comments

Comments
 (0)