自定义NodeJS构建包括javascript模块 [英] Custom NodeJS build including javascript modules

查看:91
本文介绍了自定义NodeJS构建包括javascript模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以某种方式可以与一些选定的JavaScript模块一起构建NodeJS吗?我相信对于本机模块,我应该能够使用node-gyp实现这一点,但我不知道如何为JavaScript模块执行此操作。主要的想法是能够在没有安装npm的情况下使用自定义应用程序。

is it somehow possible to build NodeJS together with some selected JavaScript modules? I believe that for native modules, I should be able to achieve this with node-gyp, but I have no idea how to do this for JavaScript modules. The main idea is to be able to use custom application without npm install.

我知道我可以使用任何捆绑器,如pkg或nexe,但这有一些缺点关于开发......

I know that I can use any of the bundlers like pkg or nexe, but this has some drawbacks with respect to the development...

谢谢!

推荐答案

您可以包含JS文件,如这里

You can include JS files as described in here.

只需添加一个link-module参数。

Just add a link-module parameter.

> .\vcbuild link-module './myCustomModule.js'

这篇关于自定义NodeJS构建包括javascript模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆