Allow for optionally disabling the title tag #766
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes
This PR wraps the title tag in the default template with a conditional that will only add the title tag if
htmlWebpackPlugin.options.title
is not equal tonull
orundefined
.Use Case
I'm building a project with a loader that injects HTML into the page, including the title tag in some places, and am using
html-wepback-plugin
to auto-generate a basic index.html page with that script included. It works fantastically except that my injected title tag isn't being respected because there is already one embedded by this plugin. This change allows you to optionally disable the addition of that title tag so an injected one is respected.Other Questions
I'm consistently getting 11 tests failing on my local installation even with no changes to any files and after I've run
yarn link
andyarn link html-webpack-plugin
in the directory. Is this expected? Is there something else I'm supposed to do?Thanks!
Garrett