feat(evo-react): enable CSS tree-shaking with preserveModules#527
feat(evo-react): enable CSS tree-shaking with preserveModules#527HenriqueLimas merged 1 commit intomainfrom
Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
There was a problem hiding this comment.
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
preserveModulesoutput inpackages/evo-reactVite build. - Adjust production TypeScript config excludes for build-time declaration output.
- Mark the package as side-effect-free via
package.jsonmetadata.
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/*"], |
There was a problem hiding this comment.
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).
| "exclude": ["./**/*.stories.tsx", "./**/test/*"], | |
| "exclude": ["./**/*.stories.tsx", "./src/**/test/**", "./src/**/__tests__/**"], |
Description
dist/index.jsfile. This is so we can tree-shake also the skin cssChecklist