@swc-node/sourcemap-support

Runtime sourcemap support in NodeJS

Usage no npm install needed!

<script type="module">
  import swcNodeSourcemapSupport from 'https://cdn.skypack.dev/@swc-node/sourcemap-support';
</script>

README

@swc-node/sourcemap-support

import { SourcemapMap, installSourceMapSupport } from '@swc-node/sourcemap-support'

function transform(sourcecode, filename, options) {
  const { code, map } = transformSync(sourcecode, filename, options)
  SourcemapMap.set(filename, map)
  return code
}