Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

css prop not working when used with typescript plugin in rollup #17

Open
khanakia opened this issue May 16, 2023 · 0 comments
Open

css prop not working when used with typescript plugin in rollup #17

khanakia opened this issue May 16, 2023 · 0 comments

Comments

@khanakia
Copy link

I am facing an issue

CSS props not working properly they are rendering as <div css="background:papayawhip;">Hello</div>

When i use the typescript plugin as below code then it does not work

typescript({ 
  tsconfig: path.resolve('./tsconfig.json'),
  transformers: [
    () => ({
      before: [styledComponentsTransformer],
    }),
  ],
}),

babel({
  extensions: [".js", ".jsx", ".ts", ".tsx"],
  plugins: ["babel-plugin-styled-components"],
  presets: [
    [ "@babel/preset-react", ],
  ],
}),

But when i use this without typescript it works

babel({
  extensions: [".js", ".jsx", ".ts", ".tsx"],
  plugins: ["babel-plugin-styled-components"],
  presets: [
    ["@babel/preset-typescript",],
    ["@babel/preset-react", ],
  ],
}),

But i need to make this work with Typescript plugin as i want the .d.ts types files to be generated as well babel does not generate the types files.

@quantizor quantizor transferred this issue from styled-components/babel-plugin-styled-components Jun 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant