Skip to content

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

Open
@khanakia

Description

@khanakia

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @khanakia

        Issue actions

          css prop not working when used with typescript plugin in rollup · Issue #17 · styled-components/typescript-styled-plugin