Repository navigation
fix(css): respect lightningcss cssModules.animation option - #1085
benjaminkincses wants to merge 1 commit into
Conversation
In transformWithLightningCSS and bundleWithLightningCSS, the spread of
options.lightningcss was followed by cssModules: options.cssModules, so
cssModules: true (from css.modules: true) silently overwrote nested
lightningcss options such as cssModules: { animation: false }.
Merge the two configs instead: object-form css.modules wins over nested
lightningcss options, and object-form lightningcss.cssModules is preserved
when css.modules is just true (or unset).
Closes rolldown#1083
✅ Deploy Preview for tsdown-main ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
tsdown
create-tsdown
@tsdown/css
@tsdown/exe
tsdown-migrate
commit: |
|
Thanks for investigating this and adding regression tests. Closing in favor of #1103. The merge here also applies #1103 merges the options in |
AI usage
Description
css.lightningcss.cssModules(e.g.{ animation: false }) was silently dropped whenevercss.modulesresolved totrue(or was unset). In bothtransformWithLightningCSSandbundleWithLightningCSS(packages/css/src/lightningcss.ts),...options.lightningcsswas spread first and thencssModules: options.cssModulesoverwrote it, so keyframes were always renamed - desyncing them from CSS-variable animation references (lightningcss known limitation).The fix merges instead of overwriting: object-form
css.modulesstill wins over nested lightningcss options, and object-formlightningcss.cssModulesis preserved whencss.modulesis justtrue(or unset).Linked Issues
Closes #1083
Additional context
Regression tests added to
packages/css/src/lightningcss.test.tscovering both transform and bundle paths: keyframes are kept global withanimation: false, still renamed by default, and object-form configs merge.