Merge branch 'dev' of https://git.verdnatura.es/salix into dev
* 'dev' of https://git.verdnatura.es/salix: install packages on folders with file package.json - gulp install
This commit is contained in:
commit
725815678d
20
gulpfile.js
20
gulpfile.js
|
@ -4,6 +4,8 @@ var wrap = require('gulp-wrap');
|
||||||
var concat = require('gulp-concat');
|
var concat = require('gulp-concat');
|
||||||
var merge = require('merge-stream');
|
var merge = require('merge-stream');
|
||||||
var extend = require('gulp-extend');
|
var extend = require('gulp-extend');
|
||||||
|
var install = require('gulp-install');
|
||||||
|
var print = require('gulp-print');
|
||||||
var del = require('del');
|
var del = require('del');
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
var webpack = require('webpack');
|
var webpack = require('webpack');
|
||||||
|
@ -159,6 +161,24 @@ gulp.task('routes', function() {
|
||||||
.pipe(gulp.dest(buildDir));
|
.pipe(gulp.dest(buildDir));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// install packages from package.json in folders.
|
||||||
|
gulp.task('install', () => {
|
||||||
|
const pathServices = './services/';
|
||||||
|
const fileJson = [];
|
||||||
|
const services = fs.readdirSync(pathServices);
|
||||||
|
services.push('..');
|
||||||
|
services.forEach((service) => {
|
||||||
|
fileJson.push(pathServices.concat(service, '/package.json'));
|
||||||
|
});
|
||||||
|
return gulp.src(fileJson)
|
||||||
|
.pipe(print((filepath) => {
|
||||||
|
return `Installing packages in ${filepath}`;
|
||||||
|
}))
|
||||||
|
.pipe(install({
|
||||||
|
npm: ['--no-package-lock']
|
||||||
|
}));
|
||||||
|
});
|
||||||
|
|
||||||
// Watch
|
// Watch
|
||||||
|
|
||||||
gulp.task('watch', function() {
|
gulp.task('watch', function() {
|
||||||
|
|
|
@ -39,6 +39,8 @@
|
||||||
"gulp": "^3.9.1",
|
"gulp": "^3.9.1",
|
||||||
"gulp-concat": "^2.6.0",
|
"gulp-concat": "^2.6.0",
|
||||||
"gulp-extend": "^0.2.0",
|
"gulp-extend": "^0.2.0",
|
||||||
|
"gulp-install": "^1.1.0",
|
||||||
|
"gulp-print": "^2.0.1",
|
||||||
"gulp-util": "^3.0.7",
|
"gulp-util": "^3.0.7",
|
||||||
"gulp-wrap": "^0.13.0",
|
"gulp-wrap": "^0.13.0",
|
||||||
"gulp-yaml": "^1.0.1",
|
"gulp-yaml": "^1.0.1",
|
||||||
|
|
Loading…
Reference in New Issue