drolsen / webpack-favicons

Plugin to generate favicons for browsers and devices

Home Page:https://github.com/drolsen/webpack-favicons

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Prefix publicPath missing

wallzero opened this issue · comments

The favicons are inserted into the given publicPath option in webpack.config.js, but the generated index.html URL's are missing the prefixed public path.

Due to the order of Webpack process assets, we must first accept incoming HTML from html-webpack-plugin, then inject the HTML generated by favicon lib into the head of the html-webpack-plugin markup.

This means we lose the opportunity for publicPath fixing done by html-webpack-plugin, but instead must do it manually.
I've dropped in a check for if webpack configuration has a defined publicPath, and if so, prepend it to the start of any href="" in the generated favicon markup.

Thanks again!