-
Notifications
You must be signed in to change notification settings - Fork 2
/
gulpfile.js
50 lines (37 loc) · 1.5 KB
/
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/**
* Gulp tasks used to automate compilation of styles, concatenation of scripts
* and the build process
*
* @version 1.0.0
*/
var gulp = require( 'gulp' ),
plugins = require( 'gulp-load-plugins' )(),
fs = require( 'fs' );
// load tasks from the gulp-tasks folder
require( 'require-dir' )( './gulp-tasks' );
if ( fs.existsSync( './gulpconfig.json' ) ) {
config = require( './gulpconfig.json' );
} else {
config = require( './gulpconfig.example.json' );
console.log( "Don't forget to create your own gulpconfig.json from gulpconfig.json.example" );
}
// -----------------------------------------------------------------------------
// Do a clean compilation of all the styles and scripts files
// with the latest configurations
// -----------------------------------------------------------------------------
function compileAll( cb ) {
return gulp.parallel( 'styles', 'scripts' )(cb);
}
compileAll.description = 'Runs all compilation tasks in sequence';
gulp.task( 'compile', compileAll );
// -----------------------------------------------------------------------------
// Convenience task for development.
//
// This is the command you run to warm the site up for development. It will do
// a full build, open BrowserSync, and start listening for changes.
// -----------------------------------------------------------------------------
function devSequence( cb ) {
return gulp.series( 'compile', 'watch', 'browser-sync' )(cb);
}
compileAll.description = 'Main development task:';
gulp.task( 'bs', devSequence );