Skip to content

Commit

Permalink
fix: Enable rslib sideEffects on react-spring
Browse files Browse the repository at this point in the history
Since the rslib migration, the mui-bottom-sheet component would not
work anymore due to `.willAdvance is not a function` error

This is due to library's side effects that are erased by the tree
shaking mechanism

To prevent that we change the rsbuild configuration to handle those
side effects

More info: pmndrs/react-spring#1078
  • Loading branch information
Ldoppea committed Feb 18, 2025
1 parent 6dff2bb commit 59c6ecd
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions rsbuild.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,18 @@ const mergedConfig = mergeRsbuildConfig(config, {
alias: {
'react-pdf$': 'react-pdf/dist/esm/entry.webpack'
}
},
tools: {
rspack: {
module: {
rules: [
{
test: /react-spring/,
sideEffects: true
}
]
}
}
}
})

Expand Down

0 comments on commit 59c6ecd

Please sign in to comment.