JS_OF_OCAML-BUILD-RUNTIME(1)
β¨ JS_OF_OCAML-BUILD-RUNTIME β¨
okay bestie, welcome to the js_of_ocaml-build-runtime page from the Js_of_ocaml Manual π
this one's all about building the standalone runtime β it's the whole point when you're doing separate compilation. sit down, grab a strawberry π, let's go.
πΈ NAME πΈ
js_of_ocaml-build-runtime β build the standalone runtime. it's used for separate compilation, no cap.
π¦ SYNOPSIS π¦
js_of_ocaml build-runtime [OPTION]β¦ [JS_FILES]β¦
π DESCRIPTION π
Js_of_ocaml is a compiler that takes OCaml bytecode and turns it into JavaScript. it's giving translator, it's giving glow-up π§ and the way it works means you can literally run pure OCaml programs inside JavaScript environments β think web browsers, think Node.js. iconic behavior honestly.
π OPTIONS (TOPLEVEL) π
--nocmis,--no-cmisβ do not include cmis when compiling toplevel. that's it, that's the whole vibe.--toplevelβ compile a toplevel and embed the necessary cmis (unless you passed--no-cmis, in which case, no cmis, we respect it). you can configure which exported compilation units go in with--export. heads up though: you'll also need to link againstjs_of_ocaml-toplevelπ«Ά
π OPTIONS (FILESYSTEM) π
--extern-fsβ configure the pseudo-filesystem so it allows registering files from outside. this is the default, bestie, it's already on β¨--file=FILEβ register[FILE]into the pseudo-filesystem.-I DIRβ add[DIR]to the list of include directories.--no-extern-fsβ configure the pseudo-filesystem to NOT allow registering files from outside. the opposite vibe entirely.--ofs=FILEβ output the filesystem to[FILE].
π ARGUMENTS π
JS_FILESβ link JavaScript files[JS_FILES]. and here's a lil trick you're gonna love: you can refer to a path relative to Findlib packages using the syntax'+pkg_name/file.js'π iykyk.
β OPTIONS β
--custom-header=VALβ give the generated JavaScript file a custom header. super useful if you want to make the script an executable file with#!/usr/bin/env nodeπ--debug=SECTIONβ enable debug for[SECTION].--debuginfo,--debug-infoβ output debug information.--disable=OPTβ disable optimization[OPT].--effects=KINDβ pick an implementation of effect handlers.[KIND]has to be one ofcps,double-translation, ordisabled(which is the default). and fr fr: effects will not be supported if you leave this unspecified π«--empty-sourcemap,--empty-source-mapβ always generate empty source maps.--enable=OPTβ enable optimization[OPT].--no-sourcemap,--no-source-mapβ don't generate a source map. and just so you know: every other source-map-related flag gets ignored once you use this one. it's giving main character, it overrides everything π--noinline,--no-inlineβ disable inlining.--noruntime,--no-runtimeβ do not include the standard runtime.-o FILE(required) β set the output file name to[FILE]. it's required bestie, you can't skip it π--prettyβ pretty print the output. aesthetic β¨-q,--quietβ suppress non-error messages. silence, but make it chic.--set=PARAM=VALUEβ set compiler options.--setenv=PARAM=VALUEβ set an environment variable statically.--source-map-inlineβ inline the sourcemap in the generated JavaScript.--source-map-no-sourceβ do not inline sources in the source map.--source-map-root=VALβ root dir for the source map.--sourcemap,--source-mapβ generate a source map.--target-env={isomorphic,browser,nodejs}(absent=isomorphic) β the runtime compile target. defaults toisomorphicif you don't say anything.-w WARNβ enable or disable the warnings specified by the argument[WARN].--Werrorβ turn all warnings into errors. dramatic? yes. effective? also yes π--wrap-with-fun=VAL(absent=<Immediately Invoked Function Expression>) β wrap the generated JavaScript code inside a function that needs to be applied with the global object.
π§ COMMON OPTIONS π§
--help[=FMT](default=auto) β show this help in formatFMT. the value ofFMTmust be one ofauto,pager,grofforplain. withauto, the format ispagerorplainwhenever theTERMenv var isdumbor undefined.--versionβ show version information.
π EXIT STATUS π
js_of_ocaml build-runtime exits with:
0β on success π123β on indiscriminate errors reported on standard error.124β on command line parsing errors.125β on unexpected internal errors (bugs). not the cute kind of bug, the bad kind π
π BUGS π
bugs are tracked on github at https://github.com/ocsigen/js_of_ocaml/issues. go tell them, they'll handle it π«Ά
π SEE ALSO π
π AUTHORS π
Jerome Vouillon, Hugo Heuzard. absolute legends, we stan π
π LICENSE π
Copyright (C) 2010-2020.
js_of_ocaml is free software, you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, with linking exception; either version 2.1 of the License, or (at your option) any later version.
and that's the whole page, bestie π this was Js_of_ocaml version 6.2.0, section JS_OF_OCAML-BUILD-RUNTIME(1) β slay, go build that runtime, you got this πβ¨
π¦ where this page comes from
- ubuntu resolute: js-of-ocaml 6.2.0-2build6 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms