Skip to content

Commit

Permalink
chore(build): remove watch:*:dev tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphael Benitte committed Apr 14, 2016
1 parent 65d9eef commit d5943d0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 23 deletions.
4 changes: 2 additions & 2 deletions gulp/tasks/js.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ function getWatcher(isDev) {
;
}

gulp.task('watch:js:dev', function () {
gulp.task('watch:js', function () {
return bundle(getWatcher(true), true)
.on('end', function () {
gutil.log(chalk.yellow('watch:js:dev watcher ready'));
gutil.log(chalk.yellow('watch:js watcher ready'));
})
;
});
Expand Down
29 changes: 8 additions & 21 deletions gulp/tasks/watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,16 @@ var gulp = require('gulp');
var path = require('path');
var config = require('../config');

function stylesWatcher(devMode) {
var appConfig = require(path.join(config.root, 'config.js'));
var theme = appConfig.theme;
var task = devMode ? 'styles:dev' : 'styles';

return gulp.watch([
config.root + path.join('config.js'), // config for `theme` property
config.mozaikSrc + path.join('styl', '**', '*'), // mozaïk base styles
config.mozaikSrc + path.join('themes', '**', '*'), // mozaïk themes
config.root + path.join('themes', '**', '*'), // custom themes
config.root + path.join('node_modules', 'mozaik-ext-*', 'styl', '**', '*') // extensions styles
], [task]);
}

gulp.task('watch:styles:dev', function () {
return stylesWatcher(true);
});


gulp.task('watch:styles', function () {
return stylesWatcher(false);
return gulp.watch([
config.root + path.join('config.js'), // config for `theme` property
config.mozaikSrc + path.join('styl', '**', '*'), // mozaïk base styles
config.mozaikSrc + path.join('themes', '**', '*'), // mozaïk themes
config.root + path.join('themes', '**', '*'), // custom themes
config.root + path.join('node_modules', 'mozaik-ext-*', 'styl', '**', '*') // extensions styles
], ['styles:dev']);
});


gulp.task('watch:dev', ['watch:styles:dev', 'watch:js:dev']);
gulp.task('watch', ['watch:styles', 'watch:js']);
gulp.task('watch', ['watch:styles', 'watch:js']);

0 comments on commit d5943d0

Please sign in to comment.