Skip to content

fix: migrate from Create React App to Vite#908

Open
Dhanushree-Microsoft wants to merge 17 commits into
devfrom
km-gen-depdh
Open

fix: migrate from Create React App to Vite#908
Dhanushree-Microsoft wants to merge 17 commits into
devfrom
km-gen-depdh

Conversation

@Dhanushree-Microsoft
Copy link
Copy Markdown
Contributor

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?

  • Yes
  • No

…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.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 like public/index.html and reportWebVitals).
  • Update container build output and static hosting path from /build to /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.

Comment thread src/App/WebApp.Dockerfile Outdated
Comment thread src/App/vite.config.ts Outdated
Comment thread src/App/package.json Outdated
Comment thread src/App/package.json Outdated
Comment thread src/App/.env Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 11, 2026 10:36
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>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 17 changed files in this pull request and generated 4 comments.

Comment thread src/App/vite.config.ts
Comment thread src/App/.env
Comment thread src/App/package.json
Comment thread src/App/package.json Outdated
Copilot AI review requested due to automatic review settings May 11, 2026 11:06
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 19 out of 21 changed files in this pull request and generated 1 comment.

Comment thread src/App/package.json
Copilot AI review requested due to automatic review settings May 18, 2026 07:06
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 18 out of 20 changed files in this pull request and generated 2 comments.

Comment thread azure.yaml
Comment thread infra/scripts/run_create_agents_scripts.sh Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 18, 2026 07:09
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 17 out of 19 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings May 19, 2026 04:56
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 20 out of 22 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants