0👍
npm pack
produces a .tgz
file https://docs.npmjs.com/cli/pack.html
Importing from this file instead of from dist
has the same behaviour as importing from a package on the registry.
Still not sure why or what npm does in creating this file, but that answers at least the question of how to mimic the behaviour of a registered package when importing from local/a repository.
Source:stackexchange.com