Skip to content

feat(evo-react): enable CSS tree-shaking with preserveModules#527

Merged
HenriqueLimas merged 1 commit intomainfrom
feat/vite-preserve-modules-tree-shaking
Feb 23, 2026
Merged

feat(evo-react): enable CSS tree-shaking with preserveModules#527
HenriqueLimas merged 1 commit intomainfrom
feat/vite-preserve-modules-tree-shaking

Conversation

@HenriqueLimas
Copy link
Member

Description

  • Change evo-react vite output to maintain the folder structure instead of bundling one single dist/index.js file. This is so we can tree-shake also the skin css

Checklist

  • I verify all changes are within scope of the linked issue
  • I added/updated/removed testing (Storybook in Skin) coverage as appropriate
  • I tested the UI in all supported browsers
  • I tested the UI in dark mode and RTL mode

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@HenriqueLimas HenriqueLimas self-assigned this Feb 19, 2026
Copilot AI review requested due to automatic review settings February 19, 2026 22:44
@changeset-bot
Copy link

changeset-bot bot commented Feb 19, 2026

⚠️ No Changeset found

Latest commit: da92afb

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
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

Updates the @evo-web/react build output to preserve module structure (instead of a single bundled file) to better support downstream tree-shaking scenarios, particularly around Skin CSS consumption.

Changes:

  • Enable Rollup preserveModules output in packages/evo-react Vite build.
  • Adjust production TypeScript config excludes for build-time declaration output.
  • Mark the package as side-effect-free via package.json metadata.

Reviewed changes

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

File Description
packages/evo-react/vite.config.js Switch Rollup output to preserveModules with a stable entry filename.
packages/evo-react/tsconfig.prod.json Update build excludes (but current glob likely won’t exclude nested test files).
packages/evo-react/package.json Set sideEffects: false to support more aggressive consumer tree-shaking.

{
"extends": "./tsconfig.json",
"exclude": ["./**/__tests__/*", "./**/*.stories.tsx"],
"exclude": ["./**/*.stories.tsx", "./**/test/*"],
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

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

tsconfig.prod.json excludes ./**/test/*, but the Vite/Vitest config expects tests under src/**/test/** (recursive). As written, nested files under a test/ folder (or deeper subfolders) would still be included in the production build and could have declaration files emitted. Update the exclude glob to match the recursive src/**/test/** pattern (and consider also excluding __tests__ if that naming is used here).

Suggested change
"exclude": ["./**/*.stories.tsx", "./**/test/*"],
"exclude": ["./**/*.stories.tsx", "./src/**/test/**", "./src/**/__tests__/**"],

Copilot uses AI. Check for mistakes.
@HenriqueLimas HenriqueLimas merged commit 030ac1b into main Feb 23, 2026
8 checks passed
@HenriqueLimas HenriqueLimas deleted the feat/vite-preserve-modules-tree-shaking branch February 23, 2026 23:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants