meshviewer/gulp/serve.js
2017-03-27 21:02:18 +02:00

40 lines
899 B
JavaScript

module.exports = function (gulp, plugins, config, env) {
const browserSync = require('browser-sync');
function getTask(task) {
return require('./tasks/' + task)(gulp, plugins, config, env);
}
gulp.task('ws', () =>
browserSync(config.browsersync)
);
gulp.task('watch:html', () =>
gulp.watch(config.src.html,
gulp.parallel(getTask('html'))
)
);
gulp.task('watch:javascript', () =>
gulp.watch(config.src.javascript,
gulp.parallel(getTask('eslint'), getTask('javascript'))
)
);
gulp.task('watch:styles', () =>
gulp.watch(config.src.sass,
gulp.parallel(getTask('sasslint'), getTask('sass'))
)
);
gulp.task('watch:json', () =>
gulp.watch(config.src.json,
gulp.parallel(getTask('jsonMinify'))
)
);
gulp.task('watch',
gulp.parallel('watch:html', 'watch:styles', 'watch:javascript', 'watch:json')
);
};