When the source maps are generated they are provided with a root option. The root is set to "../" which works for dist builds because they are in the "dist" directory and refer to files that are in the "src" directory. However with package builds (e.g. npm run build:pkg), the src directory is a direct sibling of the concatenated file. In this case root should be "".
Two potential solutions:
- Copy src into dist, so that the root can always be "".
- Make the root option configurable through buildModules.js's api so that dist builds and package builds can specify a different root value.