Closed nashbridges closed 4 months ago
The downside is that the package size will increase. The resulting map is about 900Kb (200Kb zipped), and it is duplicated both for .cjs and .mjs.
Including the full maps is not a good idea, sorry. Since you never debug the package in your target project and you don't have the package sources at hand to which the mappings point, it simply makes no sense to include those.
The source map reference line is a left over from the build process, where I generated the maps and excluded them from bundling, but didn't think about that reference line.
So, the best approach is not to generate source maps at all, at least not for packaging.
The source map reference line is a left over from the build process, where I generated the maps and excluded them from bundling, but didn't think about that reference line.
Ah, I see. So the next release won't have the hint, right?
Yep, that's the plan.
Somehow generated cjs/mjs bundles contain
line, whereas the actual sourcemap file is not included.
When using CRA (Webpack), this results in the following warning (see https://github.com/facebook/create-react-app/pull/11752)
To fix that we have either to make sure the hint line is not there, or actually generate sourcemaps. I think latter is more useful.