Completed
Pull Request — develop (#110)
by Xaver
01:03
created

gulp/serve.js   A

Complexity

Total Complexity 7
Complexity/F 1

Size

Lines of Code 29
Function Count 7

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 0
wmc 7
c 1
b 0
f 0
nc 1
mnd 0
bc 2
fnc 7
dl 0
loc 29
rs 10
bpm 0.2857
cpm 1
noi 0
1
module.exports = function (gulp, plugins, config) {
2
  const browserSync = require('browser-sync');
3
4
  function getTask(task) {
5
    return require('./tasks/' + task)(gulp, plugins, config);
6
  }
7
8
  gulp.task('ws', () =>
9
    browserSync(config.browsersync)
10
  );
11
12
  gulp.task('watch:html', () =>
13
    gulp.watch(config.src.html, gulp.parallel(getTask('html')))
14
  );
15
16
  gulp.task('watch:javascript', () =>
17
    gulp.watch(config.src.javascript, gulp.parallel(getTask('eslint'), getTask('javascript')))
18
  );
19
20
  gulp.task('watch:styles', () =>
21
    gulp.watch(config.src.sass, gulp.parallel(getTask('sasslint'), getTask('sass')))
22
  );
23
24
  gulp.task('watch:json', () =>
25
    gulp.watch(config.src.json, gulp.parallel(getTask('jsonMinify')))
26
  );
27
28
  gulp.task('watch', gulp.parallel('watch:html', 'watch:styles', 'watch:javascript', 'watch:json'));
29
};
30