本机依赖项的编译时间在节点中花费太多时间 [英] Compile time of native dependencies takes too much time in node
本文介绍了本机依赖项的编译时间在节点中花费太多时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我设置了一个gitlab运行程序,它构建了我的节点项目.一个依赖项是 nodegit
,每次我构建我的应用时,它需要 480秒
.
I setup a gitlab runner which builds my node project. One dependency is nodegit
which takes 480 seconds
every time I build my app.
$ electron-builder install-app-deps
• electron-builder version=22.9.1
• loaded configuration file=package.json ("build" field)
• rebuilding native dependencies dependencies=nodegit@0.27.0 platform=darwin arch=x64
• rebuilding native dependency name=nodegit version=0.27.0
Done in 480.36s.
有什么方法可以缓存构建这些本机依赖项吗?我发现 prebuild 创建了 tar.gz
文件.但是我不确定如何使我的项目使用此特定的预构建文件.非常感谢您的帮助!
Is there any way to cache building these native dependencies? I found prebuild which created a tar.gz
file. But I am not sure how I can make my project use this specific prebuilt file. Any help is highly appreciated!
推荐答案
从属模块发布阶段需要包含一个预构建步骤.它不应由模块使用者执行.
A prebuild step needs to be included into the dependent module publishing phase. It should not be executed by the modules consumer.
这篇关于本机依赖项的编译时间在节点中花费太多时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文