meshviewer/gulp/serve.js

40 lines
899 B
JavaScript
Raw Permalink Normal View History

2017-03-22 22:13:37 +00:00
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')
);
};