是否可以在
displayName
中禁用样式组件的 next-config.js
选项?我知道可以通过使用自定义 .babelrc
来禁用,但我不想禁用 next.js SWC,如果我创建自定义 .babelrc
,SWC 将被禁用。
是的,这是可能的。
compiler: {
styledComponents: {
displayName: true,
ssr: true,
},
来源:https://nextjs.org/docs/architecture/nextjs-compiler#supported-features