Description
I want to generate a source map when compiling my C code that includes all the source files in the source map file itself instead of having to serve all the source code files alongside the source map file. This can be done by adding a sourcesContent
key to the source map file. Otherwise I would have to upload 93 C files to npm with my JavaScript library.
wasm-sourcemap.py includes support for doing this already with the --sources
argument
emscripten/tools/wasm-sourcemap.py
Line 37 in b3c2567
but there's no way to pass that argument from the emcc
command
Lines 1107 to 1111 in b3c2567
This could be a -ginline-source-map
option or -gsource-map -s INLINE_SOURCE_MAP
, which would match TypeScript's --inlineSourceMap
. Though I expected this to be the default behavior. Serving C files over HTTP is weird.
My use case is that I have an npm package compiled with Emscripten and my source map requires files from ../../../../../../../opt/homebrew/Cellar/emscripten/3.1.61/libexec/system/lib/ and I have no idea how I could put that path in my npm module tree-sitter/tree-sitter#3381