Passed
Pull Request — develop (#256)
by Xaver
01:38
created

gulp/serve.js   A

Complexity

Total Complexity 7
Complexity/F 1

Size

Lines of Code 39
Function Count 7

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

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