I'm trying to share my Typeorm entity classes with my frontend without pulling in all of the typeorm package as it greatly increased my build size.
The suggestion in the past has been to add the Typeorm shim to your Webpack build, which basically makes all the Typeorm entities do nothing. https://github.com/typeorm/typeorm/blob/master/extra/typeorm-model-shim.js
This involves modifying your tsconfig.json file like this:
{
...
"compilerOptions": {
...
"paths": {
"typeorm": ["../node_modules/typeorm/typeorm-model-shim.js"]
}
}
}
The problem is that create-react-app now removes compilerOptions.paths from your tsconfig.json file. I do not know why it does this, but it's now making it impossible to include this shim.
Is there a way to use the Typeorm shim with create-react-app? Is there an alternative solution for using my Typeorm entities in my frontend?