fullstack-typescript
fullstack-typescript copied to clipboard
Requirement for shared files to contain third party dependencies
Curious to know if the following scenario is handled by the project where some shared files may require third party dependencies specified in its own package.json file.
Specifically, how can we include these dependencies in the build output?
Can you give a more detailed example?
Thanks for the response. Okay so it looks like you maintain a single package.json file to handle dependencies from all three packages? I guess in that case, the above issue is not really a problem.
I am currently trying out an approach where each package (client/server/shared) have their own package.json file to manage dependencies. It works well, however if the shared code has an external dependency X (defined in its own package.json file), the final build (for either the client or server), fails to run as it cannot find X. That is essentially the problem.
Would be interesting to know your thoughts on that!
Why would you want to split the package.json
? the tsconfig.json
is the section "borders".
You can define types: []
in each tsconfig.json
according to your needs.
In my case, it seems a lot more cleaner to individually maintain dependencies for the client, api, and shared directories, rather than having it globally and constantly updating types
for each project whenever things change.
You will have to update the types
with or without splitting to several package.json
If you insist, you should probably try a mono repo. approach with lerna