-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
66 lines (56 loc) · 1.57 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/**
* Gulp task runner for managing assets in a project.
*
* Before running first task make sure you have all node modules installed.
* To do so navigate to this folder and run the following command:
*
* @command: npm install
*
* Tasks available :
*
* - gulp (default)
* First runs the build task to build all the assets,
* then runs the watch task to watch for changes on the files.
*
* - gulp build
* Runs tasks to build all the assets, in parallel.
*/
'use strict';
// Include gulp.
const gulp = require('gulp');
// Config file.
const config = require('./gulp/config.json');
// Auto load all required plugins.
const $ = require('gulp-load-plugins')({
pattern: '*',
scope: 'dependencies',
rename: {
'jshint': 'jshintCore',
'jshint-stylish': 'stylish'
}
});
// Messages data for notify to display.
const messages = {
error: function (err) {
$.notify.onError({
title: config.messages.error.title,
message: config.messages.error.message
})(err);
// If notifier is disabled, still forward the error message.
if (process.env.DISABLE_NOTIFIER) {
console.log(err.message);
}
this.emit('end');
},
success: {
title: config.messages.success.title,
message: config.messages.success.message,
onLast: true
}
};
// Load tasks from files.
$.loadSubtasks('gulp/tasks/*.js', $, config, messages);
// Gulp build task to run all tasks just once, in parallel.
gulp.task('build', gulp.parallel('styles', 'scripts', 'unesco-script'));
// Default Gulp task to run.
gulp.task('default', gulp.series('build', 'watch'));