build: migrate to Vite - #252
Open
Tomahawk2191 wants to merge 10 commits into
Open
Conversation
Vite only applies the JSX transform to .jsx/.tsx by default, so every module containing JSX needs the extension. Also updates the explicit .js import specifiers in ChooseYourCharacter to match.
- swap react-scripts for vite + @vitejs/plugin-react; test runner is now vitest - move public/index.html to the project root and point it at /src/index.jsx; drop the %PUBLIC_URL% placeholders - keep build output in build/ so the existing deploy config still works - add "type": "module" so vite.config.ts loads as ESM without warning - drop the CRA-only browserslist config
CRA's `import { ReactComponent as X } from './x.svg'` has no Vite
equivalent; under Vite those bindings resolved to undefined and the
render threw, blanking the page. vite-plugin-svgr provides the same
capability through the ?react suffix.
process.env does not exist in the browser under Vite, so client.js threw a ReferenceError at module load. Vite exposes env vars through import.meta.env and only for keys prefixed VITE_, so the keys in .env are renamed to match.
Contributor
👷 Deploy Preview for sprightly-manatee-243873 processing.
|
Tomahawk2191
force-pushed
the
isaac/migrate-to-vite
branch
from
September 6, 2026 18:40
a546d27 to
49ec58a
Compare
Tomahawk2191
marked this pull request as ready for review
September 6, 2026 19:32
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.
What was the ticket?
WT-[ticket number] - [ticket title]
Ticket Link: htttps://put_the_ticket_link_here.com
What did I do?
How did I test it?
Describe in detail steps you used to test the changes you have made.
Required checks:
What could go wrong in the future? What parts of your code should the reviewer pay the most attention to?
Describe aspects of the PR that may become problems in the future.
Additional Comments for the Reviewers
Screenshots
FIGMA
MY VERSION