feat(create-vite): set default title in index.html to project name#20519
Merged
sapphi-red merged 6 commits intomainfrom Sep 22, 2025
Merged
feat(create-vite): set default title in index.html to project name#20519sapphi-red merged 6 commits intomainfrom
sapphi-red merged 6 commits intomainfrom
Conversation
Co-authored-by: sapphi-red <49056869+sapphi-red@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Implement @vitejs/vite/issues/20111
feat(create-vite): set default title in index.html to project name
Jul 31, 2025
sapphi-red
requested changes
Aug 1, 2025
…d clean up test Co-authored-by: sapphi-red <49056869+sapphi-red@users.noreply.github.com>
Copilot
AI
changed the title
feat(create-vite): set default title in index.html to project name
feat(create-vite): set default title in index.html to project name (excluding lit templates)
Aug 1, 2025
sapphi-red
requested changes
Aug 1, 2025
… titles Co-authored-by: sapphi-red <49056869+sapphi-red@users.noreply.github.com>
Copilot
AI
changed the title
feat(create-vite): set default title in index.html to project name (excluding lit templates)
feat(create-vite): set default title in index.html to project name using regex replacement
Aug 1, 2025
sapphi-red
requested changes
Aug 1, 2025
… all templates Co-authored-by: sapphi-red <49056869+sapphi-red@users.noreply.github.com>
Contributor
Author
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
sapphi-red
reviewed
Aug 1, 2025
sapphi-red
approved these changes
Aug 1, 2025
bluwy
approved these changes
Aug 5, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR implements the feature requested in #20111 to set the default title in
index.htmlto the project name instead of framework-specific titles like "Vite + React", "Vite + Vue", etc.Problem
Currently, all Vite projects created with
create-vitehave generic titles in theirindex.htmlfiles that reflect the framework used (e.g., "Vite + React", "Vite + Vue"). This creates several issues:Solution
This PR modifies the
create-vitescaffolding process to automatically replace the<title>content with the project name provided by the user using regex pattern matching.Implementation Details
index.htmlfiles maintain their original framework-specific titleswritefunction increate-vite/src/index.tsto detectindex.htmlfiles and use regex (/<title>.*?<\/title>/) to replace the title content with the project nameBefore/After Example
Before:
After:
Templates Affected
All 16 template variants now get dynamic title replacement:
template-react,template-react-tstemplate-vue,template-vue-tstemplate-svelte,template-svelte-tstemplate-vanilla,template-vanilla-tstemplate-preact,template-preact-tstemplate-qwik,template-qwik-tstemplate-solid,template-solid-tstemplate-lit,template-lit-tsBackwards Compatibility
This change is fully backwards compatible - it only affects newly created projects and doesn't impact existing functionality or workflows.
Fixes #20111
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.