【问题标题】:Whats the difference beetween deno install and deno compile?deno 安装和 deno 编译之间有什么区别?
【发布时间】:2021-01-14 07:38:27
【问题描述】:

如果我这样做 deno --help 它会显示:

  • compile = 将脚本编译成独立的可执行文件
  • install = 将脚本安装为可执行文件

这两个命令有什么区别?

【问题讨论】:

    标签: deno


    【解决方案1】:
    Command Output Self contained 1 Deno runtime integrated 2
    compile binary y y
    install script (shell / .bat) n n
    bundle .js y n
    1 自包含 := 包括本地和远程依赖项/脚本,单个文件

    2 集成 := 不需要 单独 运行时

    【讨论】:

    • 所以如果我想创建一个脚本可执行文件供其他人使用,我想使用编译对吗?
    • 视情况而定 - compiled 源比 bundle 的纯脚本文件大得多(开发人员打算在以后的版本中减少二进制大小)。因此,如果脚本大小无关紧要/客户端没有 deno 运行时/您想确保某个版本/它应该尽可能简单地执行/代码“透明度”对客户端并不重要,请使用@987654329 @,否则为bundle
    • 当我安装 TS/JS 脚本时,也会将我的脚本移动到与输出 shell/批处理相同的位置,甚至将 TS/JS 脚本嵌入其中?
    猜你喜欢
    • 2019-04-24
    • 1970-01-01
    • 2020-09-03
    • 2021-09-13
    • 2011-01-26
    • 2021-05-10
    • 1970-01-01
    • 2021-06-29
    • 2017-02-11
    相关资源
    最近更新 更多