package b0
Install
Dune Dependency
Authors
Maintainers
Sources
sha512=78fd9e53b84cf5d6bf497adaf4b6d7d974134044318639cdfe5e01c7faaa8d987d04769abe3b3b1cbdb937132e21d8723dc185cd3c68433a793278907a8e757e
doc/b0.kit/B0_jsoo/index.html
Module B0_jsoo
js_of_ocaml
B0 file support
Metadata
The type for js_of_ocaml
compilation either whole program compilation mode for runtime efficiency and minimality or `Separate
for build time efficiency.
val comp : B00_std.Cmd.t B0_meta.key
comp
are options added to the js_of_ocaml
compile
subcommand.
val comp_mode : comp_mode B0_meta.key
mode
is the js_of_ocaml
compilation mode.
FIXME this should likely be a store key.
val source_map : B00_jsoo.source_map B0_meta.key
source_map
is the source map option.
val tag : unit B0_meta.key
tag
indicates the entity is related to js_of_ocaml
.
val toplevel : bool B0_meta.key
toplevel
should be true
to embed toplevel support in the js executable.
val link : B00_std.Cmd.t B0_meta.key
link
are options added to the js_of_ocaml
link
subcommand.
val assets_root : B00_std.Fpath.t B0_meta.key
assets_root
indicates the path w.r.t. to which assets are are Fpath.reroot
ed. Assets that are not prefoxied by assets_root
are simply copied at the toplevel of the build dir.
val meta :
?meta:B0_meta.t ->
?assets_root:B00_std.Fpath.t ->
?comp:B00_std.Cmd.t ->
?comp_mode:comp_mode ->
?link:B00_std.Cmd.t ->
?requires:B00_ocaml.Lib.Name.t list ->
?source_map:B00_jsoo.source_map ->
?toplevel:bool ->
unit ->
B0_meta.t
meta
creates a base metadata dictionary for compiling with js_of_ocaml
. See the corresponding keys above. FIXME defaults.
Build units
val exe :
?doc:string ->
?meta:B0_meta.t ->
?action:B0_unit.action ->
?name:string ->
string ->
srcs:B0_srcs.sels ->
B0_unit.t
exe n
is a JavaScript "executable" file named n
(without the .js
extension).
doc
is the unit doc string.meta
is the initial metadata.requires
are the OCaml libraries required to compile the JavaScript.name
is the name of the unit (defaults ton
).srcs
are the executable sources. All files with extension.ml
,.mli
and.js
are considered for compiling and linked in the JavaScript file.
val web :
?doc:string ->
?meta:B0_meta.t ->
?action:B0_unit.action ->
?name:string ->
string ->
srcs:B0_srcs.sels ->
B0_unit.t
web n
is an HTML page named n
(without the .html
extension).
doc
is the unit doc string.meta
is the initial metadata.requires
are the OCaml libraries required to compile the JavaScript.name
is the name of the unit (defaults ton
).srcs
are the executable sources. All files with extension.ml
,.mli
and.js
are considered for compiling and linking the executable. The filesB00_fexts.www
insrcs
minus.js
files are copied over the build directory. If these files are can be rerooted to the build dir according toassets_dir
they are copied as such otherwise they are copiedassets_dir
FIXME. A competing idea was to have a notion of root induced byB0_srcs
selection. See the commented stuff there. This is likely something that will play better with generated assets. It's also sligthly borderline with deployements.
TODO document. The js file is n.js
, if there's no .html
source in the srcs a minimal HTML file is generated in which n.js
is linked as a script and any css file in srcs
as a stylesheet.