yarnadd-Dbabel-plugin-styled-components; 配置:在vite.config.ts中配置plugin: plugins:[react({babel:{plugins:[ ['babel-plugin-styled-components', {displayName:true,fileName:false} ] ] }, }), ]
I usevitev5.0.12,@babel/corev7.24.6, andbabel-plugin-styled-componentsv2.1.4. Minimal example This minimal example shows the bug: import{css}from"styled-components";constTestComponent1=()=>{letposition=1;// assume the variable is used for something else ...return;}; Here, theis transfo...
v=448fe7da as it exceeds the max of 500KB. Sourcemap for "/home/aryzing/workspace/bound-fe/node_modules/.vite/react_jsx-dev-runtime.js" points to missing source files Sourcemap for "/home/aryzing/workspace/bound-fe/node_modules/.vite/styled-components.js" points to missing source files...
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...
"styled-components": "6.0.0-rc.0" }, "devDependencies": { "dumi": "^2.2.5" "dumi": "^2.2.16" } } 2 changes: 1 addition & 1 deletion 2 docs/tsconfig.json Original file line numberDiff line numberDiff line change @@ -10,5 +10,5 @@ "@@/*": [".dumi/tmp/*"] } },...