npm packages, modular architecture, problem with managing dependencies

in our team we have decided that we will use modular architecture for our web application.
But we ran into a problem.
How to properly manage the dependencies of these packages.

There is no question with devDependencies, they are used only for the development of the package itself.

The other thing is dependencies.

We have several npm modules.
@uikit-module, @dashboard-module, @profile-module.

@dashboard-module depends on @profile-module.

@dashboard-module, @profile-module depend on @uikit-module

There are several questions:

  1. How to properly remove dependecies from the resulting build? Using external properties in the module builder.
  2. How to manage peerDependecies?
  3. What are some convenient package management tools for colocated development?

`{
“name”: “@dashboard-module”,
“dependencies”: {
“@profile-module”: “^0.0.1”,
“@uikit-module”: “^0.0.1”
}
}

{
“name”: “@profile-module”,
“dependencies”: {
“@uikit-module”: “^0.0.1”
}
}
`