Igorbek/typescript-plugin-styled-components

CRA example

phmatray opened this issue · 5 comments

Would it be possible to add an example to the README showing how to configure typescript-plugin-styled-components with CRA2 --typescript?

Thank you for filing a request.

CRA2 uses Babel to transpile code and does not use any webpack typescript loaders.
First of all, there's another solution for Babel: babel-plugin-styled-components. It might be sufficient for your goals.
Second, after some research it seems to be impossible to configure Babel's typescript transformer to use custom TypeScript transformers which the current plugin is.

I'll appreciate any information or examples from people who used this plugin with babel/CRA.
And I will continue digging into that, but it's not a priority until any useful insights come up.

FYI: CRA allows to start project with typescript support, so this plugin looks very interesting. Unfortunately, I have no idea how to make it works :(

Thank you for filing a request.

CRA2 uses Babel to transpile code and does not use any webpack typescript loaders. First of all, there's another solution for Babel: babel-plugin-styled-components.

Are you saying that your the babel plugin will work for CRA with TS, and that your plugin is only necessary for custom TS installations?

That's right, this plug-in is not for Babel. It is for such setups where the TypeScript compiler is used.

@atatakobry @phmatray I've just succeeded in getting the "original" babel plugin to work in my CRA typescript app by following the instructions here.