Commit 9d129b3
committed
feat(bundler): change bundler from tsup to vite
This PR changes the bundler of choice for the component library from tsup to vite library mode. tsup is now deprecated and its replacement option is tsdown which is a flavor of rolldown. Considering vite uses rollup (and eventually rolldown), using vite library mode makes the most sense to ensure we have a consistent bundler ecosystem across all apps and packages.
This change preserves the existing CommonJS and ESM dual output structure. It also preserves the auto-style injection functionality that was done when you import a component, it will also inject its CSS into the DOM.
On the `apps` side, webpack needs to be configured to not re-modularize CSS that was already modularized. The component library uses SASS modules which is modularized during `vite build`. However, this results in an extra modularization step in webpack which results in styles not being applied.
Furthermore, this change reduces the `common-studio` bundle size by approximately 3 mb. This was accomplished by leveraging the code splitting and CSS splitting feature made available in vite library mode which was not previously available in tsup. This allows webpack to tree shake unused dependencies.
- Update CSS module handling to prevent node_modules from being treated as CSS modules.
- Modify package.json to specify sideEffects for CSS files.
- Introduce new Vite configuration for better asset management and CSS injection.
- Remove tsup configuration file.
- Add new dependencies for CSS handling in the build process.1 parent 61663e1 commit 9d129b3
File tree
49 files changed
+2426
-480
lines changed- apps
- frontend
- packages/component-library
- src
- accordion
- faqAccordion
- actionBlock
- fullWidthActionBlock
- alert
- breadcrumbs
- button
- carousel
- checkbox
- chips
- closeButton
- dialog
- divider
- dropdown
- actionDropdown
- checkboxDropdown
- iconDropdown
- simpleDropdown
- formFieldWrapper
- header
- heroBanner
- image
- link
- list
- simpleList
- modal
- popover
- radioButton
- segmentedButtons
- slider
- tabs
- tags
- textField
- toggle
- tooltip
- typography
- video
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
49 files changed
+2426
-480
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
280 | 280 | | |
281 | 281 | | |
282 | 282 | | |
283 | | - | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
284 | 287 | | |
285 | 288 | | |
286 | 289 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
| 2 | + | |
0 commit comments