Split Gulp tasks into their own files

This commit is contained in:
Oliver Davies 2016-05-27 23:25:38 +01:00
parent c743e5f9f3
commit 5e8b52c338
11 changed files with 51 additions and 51 deletions

1
gulp/build.js Normal file
View file

@ -0,0 +1 @@
gulp.task('build', ['clean', 'styles', 'scripts', 'fonts']);

6
gulp/clean.js Normal file
View file

@ -0,0 +1,6 @@
var del = require('del');
gulp.task('clean', function () {
del.sync(config.outputDir + '/{css,js}');
del.sync('output_*/assets/{css,js}');
});

1
gulp/default.coffee Normal file
View file

@ -0,0 +1 @@
global.gulp.task 'default', ['clean', 'build']

1
gulp/default.js Normal file
View file

@ -0,0 +1 @@
gulp.task('default', ['build', 'watch']);

6
gulp/fonts.js Normal file
View file

@ -0,0 +1,6 @@
gulp.task('fonts', function () {
app.copy(
config.bowerDir + '/font-awesome/fonts/*',
config.outputDir + '/fonts'
);
});

5
gulp/minify-prod-html.js Normal file
View file

@ -0,0 +1,5 @@
gulp.task('minify-prod-html', function () {
gulp.src('output_prod/**/*.html')
.pipe(plugins.htmlmin({ collapseWhitespace: true }))
.pipe(gulp.dest('output_prod'));
});

10
gulp/scripts.js Normal file
View file

@ -0,0 +1,10 @@
gulp.task('scripts', function () {
app.js(
[
config.bowerDir + '/jquery/dist/jquery.js',
config.bowerDir + '/bootstrap-sass/assets/javascripts/bootstrap.js',
config.assetsDir + '/' + config.jsPattern
],
'site.js'
);
});

6
gulp/styles.js Normal file
View file

@ -0,0 +1,6 @@
gulp.task('styles', function () {
app.css([
config.bowerDir + '/font-awesome/css/font-awesome.css',
config.assetsDir + '/sass/site.sass'
], 'site.css');
});

6
gulp/watch.js Normal file
View file

@ -0,0 +1,6 @@
gulp.task('watch', function () {
plugins.refresh.listen();
gulp.watch(config.assetsDir + '/' + config.sassPattern, ['styles']);
gulp.watch(config.assetsDir + '/' + config.jsPattern, ['scripts']);
});