【发布时间】:2016-12-23 02:22:33
【问题描述】:
我想缩小在节点 js 上运行的项目的资产。我不想直接在目标上缩小,因为我们使用的 ARM 处理器没有足够的能力在启动时的合理时间内缩小所有资产。相反,我想在构建主机(Yocto)上启动缩小过程。我在网上搜索过有关此过程的任何帮助,但没有。
理想情况下,我想使用 node-minify 之类的东西,我可以在 Yocto 的 do_install 任务中的构建机器的 js 文件中运行它。
我首先在 (meta-nodejs/issues/62) 上寻求帮助,但没有得到帮助。因此,我现在在这里尝试,因为我们很匆忙,我真的不知道如何实现这一目标。
这是一个基本的食谱和我的问题:
SRC_URI = "svn://URL_TO_THE_TARGET_PROJECT \
file://host-minify-asset-script.js"
DEPENDS = "nodejs-native "
RDEPENDS_${PN} = "nodejs "
inherit npm npm-install
do_install() {
# This build/install dependency for target ?
oe_runnpm install
oe_runnpm prune --production
# Is it the proper way to install node-minify on the host like this ?
oe_runnpm_native install https://github.com/srod/node-minify/tarball/2.0.2
# Now, how can I run natively my script (host-minify-asset-script.js)
# to minify the assets present in the work folder of the recipe ?
}
最好的问候,
【问题讨论】: