ts-nameof icon indicating copy to clipboard operation
ts-nameof copied to clipboard

Using with a create-react-app (v2) project

Open rsuk opened this issue 6 years ago • 7 comments

Any pointers on how it might be possible to use ts-nameof with a react project using create-react-app. That now uses babel for the typescript compilation so I'm unsure if it provides the configuration points necessary to set this up?

rsuk avatar Nov 20 '18 11:11 rsuk

@rsuk no sorry! There just needs to be a way to inject a ts.TransformerFactory<ts.SourceFile> object (the export of this library) into create-react-app and it would work. I haven't found anything yet, but I'll look again soon.

dsherret avatar Nov 21 '18 03:11 dsherret

any update on this? Thanks

refex avatar Oct 28 '20 15:10 refex

@refex create-react-app is very locked down, so I'm not sure there's a way to inject the transformer into it. It might be possible with https://github.com/timarney/react-app-rewired in case anyone has time to look into it (I do not at the moment).

dsherret avatar Oct 28 '20 16:10 dsherret

thanks for the hint

refex avatar Oct 29 '20 16:10 refex

ts-nameof.macro babel-plugin-macros import nameof from 'ts-nameof.macro';

jieny avatar Mar 03 '21 01:03 jieny

ts-nameof.macro babel-plugin-macros import nameof from 'ts-nameof.macro';

can you provide more details for beginners? :-)

wondering639 avatar May 15 '21 08:05 wondering639

It's explained here:

https://stackoverflow.com/a/67670187/7027224

mmanna3 avatar May 31 '21 16:05 mmanna3