Faster npm install
gitea/salix/master This commit looks good Details

This commit is contained in:
Juan Ferrer 2019-12-30 16:57:55 +01:00
parent 98cf5a4a18
commit 435127b74a
2 changed files with 6 additions and 5 deletions

4
Jenkinsfile vendored
View File

@ -48,8 +48,8 @@ pipeline {
}
steps {
nodejs('node-lts') {
sh 'npm install --no-audit'
sh 'gulp install'
sh 'npm install --no-audit --prefer-offline'
sh 'gulp install --ci'
}
}
}

View File

@ -240,14 +240,15 @@ function install() {
const install = require('gulp-install');
const print = require('gulp-print');
let npmArgs = [];
if (argv.ci) npmArgs = ['--no-audit', '--prefer-offline'];
let packageFiles = ['front/package.json', 'print/package.json'];
return gulp.src(packageFiles)
.pipe(print(filepath => {
return `Installing packages in ${filepath}`;
}))
.pipe(install({
npm: ['--no-package-lock']
}));
.pipe(install({npm: npmArgs}));
}
install.description = `Installs node dependencies in all directories`;