require.resolve follows npm’s rules for requiring packages, but provides the absolute path to the package instead of loading the code. When we tried having wiki-server require.resolve wiki-client directly, it failed because we don’t declare a 'main' script in 'package.json' and we don’t provide the default 'index.js' either (because it’s all client side code). However, all npm packages have a 'package.json'. We can always require.resolve 'wiki-client/package.json' to resolve the location of that file on disk.
This enables wiki-server to find the static view templates in wiki-client without having to know how node_modules is organized on disk. That is important for Glitch because it uses pnpm instead of npm for installing packages and the two have different ways of organizing the filesysyem.
We may be able to use the same trick in plugmatic to enable installation of custom scoped packages in addition to globally scoped packages.