Files
vercel__next.js/test/development/basic/styled-components/next.config.js
Benjamin Woodruff a7c56a5b6b fix(turbopack-ecmascript-plugins): Accept a partial object for StyledComponentsTransformConfig (#69474)
`StyledComponentsTransformConfig` should've used `#[serde(default)]` to
allow the user to provide a partial object with only some of the fields.

https://serde.rs/container-attrs.html#default

> When deserializing, any missing fields should be filled in from the
struct's implementation of `Default`. Only allowed on structs.

Without that, when serde tries to deserialize, it is expecting that the
object has all of it's fields filled in, and breaks because you've only
got two of them. The test suite only ever tested `styledComponents:
true` (not using an object), so it missed this.

## Test Plan

```
pnpm swc-build-native
TURBOPACK=1 TURBOPACK_DEV=1 pnpm test test/development/basic/styled-components
```
2024-08-29 16:41:31 -07:00

8 lines
96 B
JavaScript

module.exports = {
compiler: {
styledComponents: {
displayName: true,
},
},
}