Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

html-loader: Add 'link:href' to attrs so favicons are parsed #943

Merged
merged 1 commit into from
Jun 7, 2018
Merged

html-loader: Add 'link:href' to attrs so favicons are parsed #943

merged 1 commit into from
Jun 7, 2018

Conversation

edmorley
Copy link
Member

@edmorley edmorley commented Jun 7, 2018

By default html-loader@0.x has a default attrs of ['img:src'], which means only <img src="..."> tags are followed when parsing the HTML:
https://github.com/webpack-contrib/html-loader/blob/v0.5.5/README.md#usage
https://github.com/webpack-contrib/html-loader/blob/v0.5.5/index.js#L29

With this change, favicons are included too, and have all the benefits of being included in the webpack build - such as being being inlined by url-loader (if small enough), or else being copied to the output directory automatically and given hashed filenames.

This matches the default that will be used in html-loader v1.0.0:
webpack-contrib/html-loader#17

...and saves projects from having to resort to the manual Neutrino API to adjust the options used by html-loader (see #682).

By default `html-loader@0.x` has a default `attrs` of `['img:src']`,
which means only `<img src="...">` tags are followed when parsing
the HTML:
https://github.com/webpack-contrib/html-loader/blob/v0.5.5/README.md#usage
https://github.com/webpack-contrib/html-loader/blob/v0.5.5/index.js#L29

With this change, favicons are included too, and have all the benefits
of being included in the webpack build - such as being being inlined
by url-loader (if small enough), or else being copied to the output
directory automatically and given hashed filenames.

This matches the default that will be used in `html-loader` v1.0.0:
webpack-contrib/html-loader#17

...and saves projects from having to resort to the manual Neutrino
API to adjust the options used by `html-loader` (see #865).
@edmorley edmorley added this to the v9 milestone Jun 7, 2018
@edmorley edmorley self-assigned this Jun 7, 2018
@edmorley edmorley requested a review from eliperelman June 7, 2018 19:28
@edmorley edmorley merged commit 0505826 into neutrinojs:master Jun 7, 2018
@edmorley edmorley deleted the html-loader-link-href branch June 7, 2018 19:49
@edmorley
Copy link
Member Author

edmorley commented Jun 7, 2018

Oops there was a typo in the commit message, #865 was meant to say #682. (I've now corrected in the PR description.)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

Successfully merging this pull request may close these issues.

2 participants