3 ms·
I’ve found that keeping separate ‘package.json’ files in a client/ and server/ directory (and thus, having separate node_modules/ directories) leads to some ann
by romellem 7y ago
I’ve found that keeping separate ‘package.json’ files in a client/ and server/ directory (and thus, having separate node_modules/ directories) leads to some annoying issues down the road.
I’ve heard that lerna[0] is maybe one tool that can help avoid this type of setup: does anyone have experience with this or recommend any other ways to organize separate dependency configurations within one mono-repo?
[0]: https://github.com/lerna/lerna https://github.com/lerna/lerna
- brod 7y agoIME, using a single package.json is a harmful and naive practice, in abstract it results in a single product version and leads to poor separation between the client(s) and server(s) codebases. It falls apart especially quickly when adding an iOS, TV (JS) or other client (or server) codebase. To resolve the multiple node_module directories you can use tooling like Workspaces[0] (with both npm and yarn) which hoists the node_modules to a "workspace level". I'd be interested in hearing other annoying issues you have with multiple package.json files. [0] https://yarnpkg.com/en/docs/workspaces/ https://yarnpkg.com/en/docs/workspaces/