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

refactor: use the `title` option in the html template, instead of hard-code the project name #5060

Merged
merged 1 commit into from Jan 13, 2020

Conversation

@sodatea
Copy link
Member

sodatea commented Jan 9, 2020

closes #5056

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Docs
  • Underlying tools
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

Other information:

…d-code the project name

closes #5056
@sodatea sodatea added the PR: Internal label Jan 9, 2020
</head>
<body>
<noscript>
<strong>We're sorry but <%= rootOptions.projectName %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
<strong>We're sorry but <%%= htmlWebpackPlugin.options.title %%> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>

This comment has been minimized.

Copy link
@pksunkara

pksunkara Jan 13, 2020

Collaborator

Why can't we use projectName from vue.config.js?

This comment has been minimized.

Copy link
@sodatea

sodatea Jan 13, 2020

Author Member

rootOptions.projectName is inferred from package.json so it's equivalent to the default title option value set below.

This PR is to make the title element in the template dynamic, so that users can change the page title by configuring html-webpack-plugin. Most common use cases may be in multi-page apps.

I originally thought the title option would be injected into the page by default, like meta tags. But it turns out that users need to place an interpolation expression in the template manually. jantimon/html-webpack-plugin#1302 (comment)

@pksunkara pksunkara merged commit bc3e4af into vuejs:dev Jan 13, 2020
7 checks passed
7 checks passed
ci/circleci: cli-ui Your tests passed on CircleCI!
Details
ci/circleci: group-1 Your tests passed on CircleCI!
Details
ci/circleci: group-2 Your tests passed on CircleCI!
Details
ci/circleci: group-3 Your tests passed on CircleCI!
Details
ci/circleci: group-4 Your tests passed on CircleCI!
Details
ci/circleci: install Your tests passed on CircleCI!
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.