将 Node.js 编译成可执行文件而不将整个 Node.js 放入其中
Compiling Node.js into an executeable without putting the entirety of Node.js in there
所以,我正在尝试将一个简单的 hello world 脚本打包成一个可执行文件,但在使用 pkg or nexe, it looks like the entirety of Node.js get's packed in there, as they are way bigger than they need to be (around 30 MB). I did stumble upon EncloseJS, however, it was last updated in 2017 and no longer works (and the owner themself advices you to switch to pkg) 时。
那么,还有其他比这更好的编译器吗?
提前致谢!
此外:这是一个极其复杂的脚本,需要 运行
console.log("Whosebug is amazing!");
setTimeout(() => {
process.exit(0);
}, 2000);
以及我本地安装的版本:
NPM
Node
6.14.12
14.16.1
所以,我正在尝试将一个简单的 hello world 脚本打包成一个可执行文件,但在使用 pkg or nexe, it looks like the entirety of Node.js get's packed in there, as they are way bigger than they need to be (around 30 MB). I did stumble upon EncloseJS, however, it was last updated in 2017 and no longer works (and the owner themself advices you to switch to pkg) 时。
那么,还有其他比这更好的编译器吗?
提前致谢!
此外:这是一个极其复杂的脚本,需要 运行
console.log("Whosebug is amazing!");
setTimeout(() => {
process.exit(0);
}, 2000);
以及我本地安装的版本:
NPM | Node |
---|---|
6.14.12 | 14.16.1 |