strothj / react-app-rewire-typescript-babel-preset

Add TypeScript support to Create React App using @babel/preset-typescript
https://react-app-rewire-typescript-babel-preset.netlify.com
MIT License
52 stars 6 forks source link

Monorepo and CRA 2 #29

Closed deftomat closed 5 years ago

deftomat commented 5 years ago

I'm having issue with monorepo with a multiple TypeScript packages.

Previously, I was able to import any TypeScript file from another package and compilation will handle it. However, after upgrading from 2.0.0-next.3e165448 to 2.0.4 typescript files from another packages or even from another directory than src are not compiled anymore.

Any suggestions why this happens?

strothj commented 5 years ago

Hello,

Unfortunately monorepo support was dropped between the beta and final release. I added some information about the situation here: https://github.com/strothj/react-app-rewire-typescript-babel-preset/issues/30

It should be possible to reproduce that monorepo support by reviewing the the changes in the files listed in that linked issue. The CRA team also outlined some alternatives.

deftomat commented 5 years ago

Thank you for a detailed report in #30 👍

I think that it is time to create my own build config as CRA brings more harm than good for us. We always need to rewire it anyway 😞 .

I think that the biggest issue they have with a monorepo support is that they don't know if package should be transpiled or not. For TypeScript users, it's not a problem as we always need to transpile *.ts files.