Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 Jun 7, 2018
@edmorley edmorley merged commit 0505826 into neutrinojs:master Jun 7, 2018
2 checks passed
@edmorley edmorley deleted the html-loader-link-href branch Jun 7, 2018
@edmorley
Copy link
Member Author

@edmorley 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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

None yet

2 participants