Open JasonGross opened 2 months ago
does the .byte file have to have the same stem that the .js file will eventually have for --source-map to work correctly?
You can control the name of the generated file with -o FILE
. When using source-map, the source-map filename is derived from the generated filename.
For example, js_of_ocaml main.byte --source-map -o jsfile.js
will generate a js file jsfile.js
referencing a source-map file jsfile.map
.
do I have to call js_of_ocaml on a .byte file whose directory relative to the cwd is the same as what it will be on the website I'm building, for --source-map to work? (it seems that it bakes in relative paths...)
By default, jsoo embed sources inside the sourcemap file to ease its usage. If you don't embed the sources, Don't you have the sources embeded ?
Is your feature request related to a problem? Please describe.
In the build system for my project, I generate a couple different versions of the .byte files, and then pick one and install it, renaming it in the process. When this happens, it seems like the .map files refer to the wrong files (and locations).
Describe the solution you'd like
I'd like the documentation to specify the constraints on correct use of
--source-map
, and, ideally, for the generated files to either be relocatable and renamable, or forjs_of_ocaml
to take options that tell--source-map
how files will be relocated and renamed.Questions that are not made clear in the documentation:
--source-map
to work correctly?js_of_ocaml
on a.byte
file whose directory relative to the cwd is the same as what it will be on the website I'm building, for--source-map
to work? (it seems that it bakes in relative paths...)Describe alternatives you've considered