fix: migrate from Create React App to Vite#908
Open
Dhanushree-Microsoft wants to merge 17 commits into
Open
Conversation
…and configurations - Changed project structure to support Vite as the build tool. - Updated package.json to replace react-scripts with Vite and adjusted scripts accordingly. - Removed public/index.html as it is no longer needed with Vite. - Updated environment variable access from process.env to import.meta.env. - Modified TypeScript configuration to target ES2020 and updated module resolution. - Removed reportWebVitals and adjusted testing setup for Vitest. - Added Vite configuration file for server and build settings.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR migrates the frontend from Create React App (CRA) to Vite, updating build/test tooling and switching environment variable access from process.env.REACT_APP_* to import.meta.env.VITE_*. It also updates Docker/Nginx static serving to use Vite’s dist/ output.
Changes:
- Replace CRA build/test setup with Vite + Vitest (new
vite.config.ts, updated tests setup, updated TS config). - Update runtime/build environment handling (
VITE_*variables,import.meta.env, remove CRA-only artifacts likepublic/index.htmlandreportWebVitals). - Update container build output and static hosting path from
/buildto/dist.
Reviewed changes
Copilot reviewed 15 out of 17 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/App/WebApp.Dockerfile | Switches Docker build to Vite output (dist/) and adjusts dependency install behavior. |
| src/App/vite.config.ts | Adds Vite config including dev-server proxy and Vitest setup. |
| src/App/tsconfig.json | Updates TS settings for Vite/modern bundling and Vitest typings. |
| src/App/src/state/store.ts | Updates env mode detection to import.meta.env.MODE. |
| src/App/src/setupTests.ts | Switches jest-dom setup to the Vitest-compatible entrypoint. |
| src/App/src/reportWebVitals.ts | Removes CRA web-vitals reporting helper. |
| src/App/src/react-app-env.d.ts | Replaces CRA react-scripts typings reference with Vite typings. |
| src/App/src/index.tsx | Removes reportWebVitals() usage. |
| src/App/src/configs/Utils.tsx | Switches config path env var to VITE_CONFIG_PATH. |
| src/App/src/App.test.tsx | Adds Vitest imports for test definitions/assertions. |
| src/App/src/api/httpClient.ts | Switches API base URL env var to VITE_API_BASE_URL. |
| src/App/public/index.html | Removes CRA HTML template (Vite uses root index.html). |
| src/App/package.json | Replaces CRA scripts/deps with Vite/Vitest, updates TypeScript versioning, adjusts overrides. |
| src/App/index.html | Adds Vite HTML entrypoint. |
| src/App/.gitignore | Ignores Vite output directory (dist/). |
| src/App/.env | Updates env var naming from REACT_APP_* to VITE_*. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…nal ports and environment variable prefixes
…v.production for API base URL
Agent-Logs-Url: https://github.com/microsoft/Conversation-Knowledge-Mining-Solution-Accelerator/sessions/ded6036c-43b4-462c-b7a0-f8c5483b6a1f Co-authored-by: Dhanushree-Microsoft <250931221+Dhanushree-Microsoft@users.noreply.github.com>
…edge-Mining-Solution-Accelerator into km-gen-depdh # Conflicts: # src/App/package-lock.json
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
… and setup scripts
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.
Purpose
This pull request migrates the React app from Create React App (CRA) to Vite, modernizing the build system, updating dependencies, and cleaning up configuration and environment handling. The changes improve build speed, update tooling, and streamline the development workflow. Key updates include replacing CRA scripts and config files with Vite equivalents, updating environment variable usage, and cleaning up obsolete or redundant files.
These changes collectively modernize the app’s tooling and development workflow, making builds faster and the configuration more maintainable.
Does this introduce a breaking change?