Skip to content

refactor: replace @vitejs/plugin-react-swc with @vitejs/plugin-react … - #148

Open
freds-dev wants to merge 2 commits into
mainfrom
freds-dev/147-resolve-vite-warnings
Open

refactor: replace @vitejs/plugin-react-swc with @vitejs/plugin-react …#148
freds-dev wants to merge 2 commits into
mainfrom
freds-dev/147-resolve-vite-warnings

Conversation

@freds-dev

Copy link
Copy Markdown
Collaborator

This PR resolves the Vite warnings shown when running the Chartlets demo UI locally.

Changes:

  • Replaces @vitejs/plugin-react-swc with @vitejs/plugin-react in the demo and library packages.
  • Updates both Vite configs to use import.meta.dirname instead of __dirname.
  • Updates chartlets.js/package-lock.json.
  • Adds a short entry to chartlets.js/CHANGES.md.

Motivation

Vite warns that __dirname is unsupported by the upcoming native config loader behavior. It also recommends switching from @vitejs/plugin-react-swc to @vitejs/plugin-react because no SWC plugins are configured.

These warnings appear when running:

cd chartlets.js/packages/demo
npm run dev

Verification

Tested locally with Node v22.13.1:

cd chartlets.js/packages/demo
npm run dev

The dev server starts without the previous Vite/native-config and React SWC warnings.

closes #147

…and update Vite config paths

- Updated package.json files in demo and lib packages to use @vitejs/plugin-react version 5.1.1 instead of @vitejs/plugin-react-swc version 4.3.1.
- Modified vite.config.ts files in demo and lib packages to resolve paths using import.meta.dirname for better directory handling.
@freds-dev
freds-dev requested review from clarasb and forman September 9, 2026 06:41
@codecov

codecov Bot commented Sep 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.68%. Comparing base (1b541a9) to head (3782561).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #148      +/-   ##
==========================================
+ Coverage   93.57%   93.68%   +0.11%     
==========================================
  Files          91       91              
  Lines        1665     1664       -1     
  Branches      262      262              
==========================================
+ Hits         1558     1559       +1     
+ Misses         91       90       -1     
+ Partials       16       15       -1     
Flag Coverage Δ
frontend 87.91% <ø> (+0.21%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread chartlets.js/CHANGES.md
@@ -1,5 +1,8 @@
## Version 0.2.2 (in development)

* Replaced `@vitejs/plugin-react-swc` with `@vitejs/plugin-react` and

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

You can mention the issue number in this change.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Done. Thanks!

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.

Resolve Vite dev server warnings in Chartlets frontend packages

3 participants