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.
Environment
None
Activity
Show:
Ned Zimmerman May 10, 2021 at 8:52 PM
If I'm understanding this correctly I think that gracefully handling different root options through the buildModules.js API (option 2) would be preferable— putting `src` into `dist` seems potentially confusing.
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.