Fixed gulpfile not cleaning temp-files

This commit is contained in:
Tobias Reich 2014-11-02 00:08:47 +01:00
parent a54dd628cf
commit f0c078d62f

View File

@ -33,30 +33,39 @@ paths.view = {
gulp.task('view--js', function() {
return gulp.src(paths.view.js)
var stream =
gulp.src(paths.view.js)
.pipe(plugins.concat('_view--javascript.js', {newLine: "\n"}))
.pipe(gulp.dest('../dist/'));
return stream;
});
gulp.task('view--coffee', function() {
return gulp.src(paths.view.coffee)
var stream =
gulp.src(paths.view.coffee)
.pipe(plugins.coffee({bare: true}))
.on('error', catchError)
.pipe(plugins.concat('_view--coffee.js', {newLine: "\n"}))
.pipe(gulp.dest('../dist/'));
return stream;
});
gulp.task('view--scripts', ['view--js', 'view--coffee'], function() {
return gulp.src(paths.view.scripts)
var stream =
gulp.src(paths.view.scripts)
.pipe(plugins.concat('view.js', {newLine: "\n"}))
.pipe(plugins.uglify())
.on('error', catchError)
.pipe(gulp.dest('../dist/'));
return stream;
});
/* Main ----------------------------------------- */
@ -88,35 +97,45 @@ paths.main = {
gulp.task('main--js', function() {
return gulp.src(paths.main.js)
var stream =
gulp.src(paths.main.js)
.pipe(plugins.concat('_main--javascript.js', {newLine: "\n"}))
.pipe(gulp.dest('../dist/'));
return stream;
});
gulp.task('main--coffee', function() {
return gulp.src(paths.main.coffee)
var stream =
gulp.src(paths.main.coffee)
.pipe(plugins.coffee({bare: true}))
.on('error', catchError)
.pipe(plugins.concat('_main--coffee.js', {newLine: "\n"}))
.pipe(gulp.dest('../dist/'));
return stream;
});
gulp.task('main--scripts', ['main--js', 'main--coffee'], function() {
return gulp.src(paths.main.scripts)
var stream =
gulp.src(paths.main.scripts)
.pipe(plugins.concat('main.js', {newLine: "\n"}))
.pipe(plugins.uglify())
.on('error', catchError)
.pipe(gulp.dest('../dist/'));
return stream;
});
gulp.task('main--styles', function() {
return gulp.src(paths.main.styles)
var stream =
gulp.src(paths.main.styles)
.pipe(plugins.sass())
.on('error', catchError)
.pipe(plugins.concat('main.css', {newLine: "\n"}))
@ -124,21 +143,30 @@ gulp.task('main--styles', function() {
.pipe(plugins.minifyCss())
.pipe(gulp.dest('../dist/'));
return stream;
});
/* Clean ----------------------------------------- */
gulp.task('clean', function() {
return gulp.src('../dist/_*.*', { read: false })
var stream =
gulp.src('../dist/_*.*', { read: false })
.pipe(plugins.rimraf({ force: true }))
.on('error', catchError);
return stream;
});
/* Tasks ----------------------------------------- */
gulp.task('default', ['view--scripts', 'main--scripts', 'main--styles', 'clean']);
gulp.task('default', ['view--scripts', 'main--scripts', 'main--styles'], function() {
gulp.start('clean');
});
gulp.task('watch', ['default'], function() {