-
Notifications
You must be signed in to change notification settings - Fork 53
Description
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 using tsc 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!