forked from humanmade/hm-pattern-library
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
26 lines (21 loc) · 910 Bytes
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
const requireDir = require('require-dir');
const gulp = require( 'gulp' );
const watch = require( 'gulp-watch' );
const del = require( 'del' );
// For neatness, most tasks have been split up into separate files
// Just load them all from ./gulp directory.
requireDir( './gulp' );
// Task to cleanup the dist directory.
gulp.task( 'clean-dist', ( cb ) => {
return del( ['./dist/**/*', '!./dist/.git' ], cb );
});
// Watch for changes in HTML/JS/CSS.
gulp.task( 'watch', () => {
gulp.watch( 'src/styles/**/*.scss', ['styles'] );
gulp.watch( 'src/js/**/*.js', ['js'] );
gulp.watch( 'src/html/**/*.html', ['fileinclude'] );
});
// Default task. Do everything.
gulp.task( 'default', [ 'styles', 'js', 'svg', 'images', 'fileinclude', 'lint' ] );
// Build task. Should be run before release.
gulp.task( 'build', [ 'clean-dist', 'styles', 'js', 'svg', 'images', 'fileinclude' ] );