Skip to content
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

Requirement for shared files to contain third party dependencies #45

Open
priyath opened this issue Apr 14, 2021 · 5 comments
Open

Requirement for shared files to contain third party dependencies #45

priyath opened this issue Apr 14, 2021 · 5 comments

Comments

@priyath
Copy link

priyath commented Apr 14, 2021

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?

@gilamran
Copy link
Owner

Can you give a more detailed example?

@priyath
Copy link
Author

priyath commented Apr 14, 2021

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!

@gilamran
Copy link
Owner

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.

@priyath
Copy link
Author

priyath commented Apr 18, 2021

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.

@gilamran
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants