Skip to content

Allow for optionally disabling the title tag #766

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

Closed
wants to merge 1 commit into from
Closed

Allow for optionally disabling the title tag #766

wants to merge 1 commit into from

Conversation

gkjohnson
Copy link

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 to null or undefined.

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 and yarn link html-webpack-plugin in the directory. Is this expected? Is there something else I'm supposed to do?

Thanks!
Garrett

@jantimon
Copy link
Owner

wouldn't it be better to use a custom template without the title for your use case?

@gkjohnson
Copy link
Author

I definitely could, but it seemed like such a simple thing and was surprised I couldn't disable the auto-inclusion of the title tag by default. It seems like the built in template should be (or be able to be) the most bare-bones page possible so your scripts or other imports can do the work if you want, so I thought I'd suggest the modification here.

@jantimon jantimon closed this Mar 20, 2018
@lock
Copy link

lock bot commented May 31, 2018

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators May 31, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants