-
Notifications
You must be signed in to change notification settings - Fork 54
Transpiling shared project multiple times as well as other possible tsconfig issues #37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
It's very interesting what you're saying here, I'll look into it. |
ok, so regarding the Regarding the client, and not using I've removed the Having I'd really appreciate your comments before I close this issue. |
Ah dang, I was hoping you might have more info on bundlers respecting project references outside of what I had found but sounds good. In regards to |
Why don't you think |
Through various unresolved/closed after thread has gone silent Github issues. However, I just found a webpack plugin that does support it. Various unresolved Github issues(only results I can find on it aka: No mention of full support) with bundlers in regards to TS Project References Webpack Rollup Parcel As far as why I think that |
If I'm not mistaken, the tsconfig project reference tree you have in
/src
and then also within your child leaf nodes on/src/client
and/src/server
are redundant. Right now you have a build script for the server that runs the tsconfig in the/src
directory. This will transpile the server and the shared directories. Then inside of your/src/server
tsconfig you are referencing the shared directory again which then transpiles and overwrites the already transpiled code. It seems you would just need one or the other.You are also referencing the shared directory in the
/src/client
's tsconfig, however you are using webpack to bundle the client and not usingtsc
so it's not taking advantage of the project reference unless using ts-loader (which you aren't) which isn't fully supporting typescript project references from what I've last read anyways. It is still bundling some of the shared files in with one of the bundles by following the imports from your files I would assume. Please correct me if I'm wrong on this, I've been looking into finding if any of the main bundlers (rollup, webpack, or parcel) support tsconfig project references and can't seem to find much.Also, keep in mind that having
"types": []
in a tsconfig can cause issues because it will not defaultly grab for any definitely typed packages that you consume and you'll have to manually put the path into that array unless that was your intention for the client to not consume any of the@types
packages.If I'm way off on this, I'd love to hear a response. I was looking into this and liked what you were doing but the tsconfigs have thrown me off for the past 6 hours or so. Thanks!
The text was updated successfully, but these errors were encountered: