Closed satouriko closed 2 months ago
Is there anyway that could read sourcemap from the webpack context via swc-loader, like babel does
SWC's plugin have no access to host's javascript runtime, that's the reason plugin accepts an object to consume but do not have way to access external. Unless I miss some additional context, I don't think this is an immediate actionable item on the plugin side.
End up making https://github.com/satouriko/swc-loader-coverage-instrument as a workaround before swc makes it to pass inputSourceMap
to plugins.
I'm trying to instrument code with swc, using this plugin and swc-loader.
This problem is, the generated code doesn't include a
inputSourceMap
field as the babel plugin does. Here's the babel one,I can only find an option
inputSourceMap
which requires a sourcemap object. Is there anyway that could read sourcemap from the webpack context via swc-loader, like babel does?