1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
v/cmd/v/help/build-js.txt
2021-12-15 15:47:34 +02:00

31 lines
1.3 KiB
Plaintext

Usage: v -b js [-options] ['run'] <target.v|target_directory> [run options]
This command compiles the given target, along with their dependencies, into an Javascript source file.
Note that `js` defaults to the `node` codegen backend but it's also possible to pick another:
* `js_browser` - V outputs JS source code ready for the browser.
* `js_node` - V outputs JS source code to run with nodejs.
* `js_freestanding` - V outputs JS source code with no hard runtime dependency.
For more general build help, see also `v help build`.
# Interfacing the Javascript Backend code generation, passing options to it:
-es5
Compile V to ES5 compatible code possibly shrinking output. Note that this flag might limit some types capabilities.
-prod
Do not create any JS Doc comments
-sourcemap
Create a source map for debugging
-sourcemap-inline
Embed the source map directly into the JavaScript source file
(currently default, external source map files not implemented)
-sourcemap-src-include
Include the orginal V source files into the generated source map
(default false, all files in the source map are currently referenced by their absolute system file path)
The supported targets for the JS backend are: ES6 strict