pradel / create-react-app-esbuild

Use esbuild in your create-react-app for faster compilation, development and tests
MIT License
562 stars 34 forks source link

How to resolve aliases via Typescript paths? #28

Open davnicwil opened 3 years ago

davnicwil commented 3 years ago

Thanks for this great plugin!

Is there a way to have it resolve aliases via the Typescript paths setting in tsconfig.json?

Out of the box, code that compiles fine with rescripts start does not compile with the setup described in the readme here (i.e. just CracoEsbuildPlugin configured in craco.config.js, nothing else) and craco start -- compilation fails on module resolution for any alias.

I noticed that esbuild itself theoretically has support for this (see here) though apparently not without the --bundle flag set. Is that the limitation here? Or is this something that needs to be configured in some particular way for craco?