Skip to content

Commit

Permalink
Upgrade gulp v4 (#6143)
Browse files Browse the repository at this point in the history
* deps: update dependency gulp to ^4.0.0

*  deps: drop deprecated gulp-util dependency

* deps: drop gulp-watch dependency

Gulp v4 integrates a watch mecanism, there is no need
for gulp-watch anymore.
  • Loading branch information
aduh95 authored and arcanis committed Aug 22, 2018
1 parent 01f9adc commit 3838739
Show file tree
Hide file tree
Showing 3 changed files with 502 additions and 572 deletions.
18 changes: 8 additions & 10 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ const plumber = require('gulp-plumber');
const newer = require('gulp-newer');
const babel = require('gulp-babel');
const sourcemaps = require('gulp-sourcemaps');
const watch = require('gulp-watch');
const gutil = require('gulp-util');
const log = require('fancy-log');
const gulpif = require('gulp-if');
const gulp = require('gulp');
const path = require('path');
Expand All @@ -21,7 +20,7 @@ const build = (lib, opts) =>
gulp.src('src/**/*.js')
.pipe(plumber({
errorHandler(err) {
gutil.log(err.stack);
log.error(err.stack);
},
}))
.pipe(newer(lib))
Expand All @@ -30,14 +29,13 @@ const build = (lib, opts) =>
.pipe(gulpif(argv.sourcemaps, sourcemaps.write('.', {sourceRoot: '../src'})))
.pipe(gulp.dest(lib));

gulp.task('default', ['build']);

gulp.task('build', () =>
build('lib', babelRc.env[majorVer >= 5 ? 'node5' : 'pre-node5'])
);

gulp.task('watch', ['build'], () => {
watch('src/**/*', () => {
gulp.start('build');
});
});
gulp.task('default', gulp.task('build'));

gulp.task(
'watch',
gulp.series('build', () => gulp.watch('src/**/*', gulp.task('build')))
);
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,15 @@
"eslint-plugin-relay": "^0.0.24",
"eslint-plugin-yarn-internal": "file:scripts/eslint-rules",
"execa": "^0.10.0",
"fancy-log": "^1.3.2",
"flow-bin": "^0.66.0",
"git-release-notes": "^3.0.0",
"gulp": "^3.9.0",
"gulp": "^4.0.0",
"gulp-babel": "^7.0.0",
"gulp-if": "^2.0.1",
"gulp-newer": "^1.0.0",
"gulp-plumber": "^1.0.1",
"gulp-sourcemaps": "^2.2.0",
"gulp-util": "^3.0.7",
"gulp-watch": "^5.0.0",
"jest": "^22.4.4",
"jsinspect": "^0.12.6",
"minimatch": "^3.0.4",
Expand Down
Loading

0 comments on commit 3838739

Please sign in to comment.