yarnadd-Dbabel-plugin-styled-components; 配置:在vite.config.ts中配置plugin: plugins:[react({babel:{plugins:[ ['babel-plugin-styled-components', {displayName:true,fileName:false} ] ] }, }), ]
我正在使用这个实现,一切似乎都像一个魅力工作
],"plugins": ["@babel/plugin-transform-arrow-functions","@babel/plugin-proposal-optional-chaining","@babel/plugin-proposal-nullish-coalescing-operator","@babel/plugin-proposal-object-rest-spread","@babel/plugin-proposal-class-properties","babel-plugin-styled-components"],"sourceMaps":"both"} Tech...
BTW I am using Vite Some components depend on @babel/runtime, but when I bundle component without @babel/runtime installed( for example when I compile with esbuild or swc ) It's not kind for new users Author fengzilong commented Oct 16, 2021 Install @babel/runtime can solve this prob...
Also having this issue with Vite - when configured using "@vitejs/plugin-legacy" as so: plugins: [ ... legacy({ targets: ["defaults, ie >= 11"], // include polyfills from core-js for this set of browsers additionalLegacyPolyfills: [ "proxy-polyfill/proxy.min.js", // immer requires...