summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/classes/npm.bbclass13
1 files changed, 11 insertions, 2 deletions
diff --git a/meta/classes/npm.bbclass b/meta/classes/npm.bbclass
index c5380405af..a69bedbb28 100644
--- a/meta/classes/npm.bbclass
+++ b/meta/classes/npm.bbclass
@@ -14,6 +14,7 @@ def npm_oe_arch_map(target_arch, d):
14 return target_arch 14 return target_arch
15 15
16NPM_ARCH ?= "${@npm_oe_arch_map(d.getVar('TARGET_ARCH'), d)}" 16NPM_ARCH ?= "${@npm_oe_arch_map(d.getVar('TARGET_ARCH'), d)}"
17NPM_INSTALL_DEV = "0"
17 18
18npm_do_compile() { 19npm_do_compile() {
19 # Copy in any additionally fetched modules 20 # Copy in any additionally fetched modules
@@ -23,12 +24,20 @@ npm_do_compile() {
23 # changing the home directory to the working directory, the .npmrc will 24 # changing the home directory to the working directory, the .npmrc will
24 # be created in this directory 25 # be created in this directory
25 export HOME=${WORKDIR} 26 export HOME=${WORKDIR}
26 npm config set dev false 27 if [ "${NPM_INSTALL_DEV}" = "1" ]; then
28 npm config set dev true
29 else
30 npm config set dev false
31 fi
27 npm set cache ${WORKDIR}/npm_cache 32 npm set cache ${WORKDIR}/npm_cache
28 # clear cache before every build 33 # clear cache before every build
29 npm cache clear 34 npm cache clear
30 # Install pkg into ${S} without going to the registry 35 # Install pkg into ${S} without going to the registry
31 npm --arch=${NPM_ARCH} --target_arch=${NPM_ARCH} --production --no-registry install 36 if [ "${NPM_INSTALL_DEV}" = "1" ]; then
37 npm --arch=${NPM_ARCH} --target_arch=${NPM_ARCH} --no-registry install
38 else
39 npm --arch=${NPM_ARCH} --target_arch=${NPM_ARCH} --production --no-registry install
40 fi
32} 41}
33 42
34npm_do_install() { 43npm_do_install() {