classes/npm: allow installation of devDependencies
Often, eg when using angular2, there's a need to install also the devDependencies. The default is to keep the old behaviour, to not install devDependencies. (From OE-Core rev: 9377d16751aeff0a913e754d711bca6e4e4d9df1) Signed-off-by: Anders Darander <anders@chargestorm.se> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
6fa0fda116
commit
b1f10b18ea
|
@ -14,6 +14,7 @@ def npm_oe_arch_map(target_arch, d):
|
||||||
return target_arch
|
return target_arch
|
||||||
|
|
||||||
NPM_ARCH ?= "${@npm_oe_arch_map(d.getVar('TARGET_ARCH'), d)}"
|
NPM_ARCH ?= "${@npm_oe_arch_map(d.getVar('TARGET_ARCH'), d)}"
|
||||||
|
NPM_INSTALL_DEV = "0"
|
||||||
|
|
||||||
npm_do_compile() {
|
npm_do_compile() {
|
||||||
# Copy in any additionally fetched modules
|
# Copy in any additionally fetched modules
|
||||||
|
@ -23,12 +24,20 @@ npm_do_compile() {
|
||||||
# changing the home directory to the working directory, the .npmrc will
|
# changing the home directory to the working directory, the .npmrc will
|
||||||
# be created in this directory
|
# be created in this directory
|
||||||
export HOME=${WORKDIR}
|
export HOME=${WORKDIR}
|
||||||
npm config set dev false
|
if [ "${NPM_INSTALL_DEV}" = "1" ]; then
|
||||||
|
npm config set dev true
|
||||||
|
else
|
||||||
|
npm config set dev false
|
||||||
|
fi
|
||||||
npm set cache ${WORKDIR}/npm_cache
|
npm set cache ${WORKDIR}/npm_cache
|
||||||
# clear cache before every build
|
# clear cache before every build
|
||||||
npm cache clear
|
npm cache clear
|
||||||
# Install pkg into ${S} without going to the registry
|
# Install pkg into ${S} without going to the registry
|
||||||
npm --arch=${NPM_ARCH} --target_arch=${NPM_ARCH} --production --no-registry install
|
if [ "${NPM_INSTALL_DEV}" = "1" ]; then
|
||||||
|
npm --arch=${NPM_ARCH} --target_arch=${NPM_ARCH} --no-registry install
|
||||||
|
else
|
||||||
|
npm --arch=${NPM_ARCH} --target_arch=${NPM_ARCH} --production --no-registry install
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
npm_do_install() {
|
npm_do_install() {
|
||||||
|
|
Loading…
Reference in New Issue