diff options
author | Nayeem Rahman <nayeemrmn99@gmail.com> | 2021-01-04 23:15:52 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-05 00:15:52 +0100 |
commit | cbc2108525f3a01f4a944104457939b741c9898b (patch) | |
tree | 58f85bcd8998101762623737dc272bff81cad15a /docs/tools | |
parent | 444eca80a93c2631623578c1febdedb43575a911 (diff) |
feat(cli/standalone): support runtime flags for deno compile (#8738)
Diffstat (limited to 'docs/tools')
-rw-r--r-- | docs/tools/compiler.md | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/docs/tools/compiler.md b/docs/tools/compiler.md index 34dbbdcc8..f468a56c6 100644 --- a/docs/tools/compiler.md +++ b/docs/tools/compiler.md @@ -3,16 +3,34 @@ > Since the compile functionality is relatively new, the `--unstable` flag has > to be set in order for the command to work. -`deno compile [SRC] [OUT]` will compile the script into a self contained -executable. +`deno compile [--output <OUT>] <SRC>` will compile the script into a +self-contained executable. ``` -> deno compile --unstable https://deno.land/std/http/file_server.ts +> deno compile --unstable https://deno.land/std/examples/welcome.ts ``` If you omit the `OUT` parameter, the name of the executable file will be inferred. +### Flags + +As with [`deno install`](./script_installer.md), the runtime flags used to +execute the script must be specified at compilation time. This includes +permission flags. + +``` +> deno compile --unstable --allow-read --allow-net https://deno.land/std/http/file_server.ts +``` + +[Script arguments](../getting_started/command_line_interface.md#script-arguments) +can be partially embedded. + +``` +> deno compile --unstable --allow-read --allow-net https://deno.land/std/http/file_server.ts -p 8080 +> ./file_server --help +``` + ### Cross Compilation Cross compiling binaries for different platforms is not currently possible. |