-
Notifications
You must be signed in to change notification settings - Fork 5
/
Gulpfile.js
40 lines (32 loc) · 1.15 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
/**
* @fileoverview Initialization for all the general gulp tasks.
*/
const gulp = require('gulp');
const path = require('path');
const runSequence = require('run-sequence').use(gulp);
global.rootRequire = (name) => {
return require(path.join(__dirname, name));
};
const args = rootRequire('./gulp/args');
// Register other tasks from separate files
const gulpHooksTasksRegister = rootRequire('./gulp/tasks/hooks');
gulpHooksTasksRegister(gulp);
// Only add these tasks if we're in development mode
if (args.env === "development") {
const gulpTestsTasksRegister = rootRequire('./gulp/tasks/tests');
gulpTestsTasksRegister(gulp);
const gulpLintJsTasksRegister = rootRequire('./gulp/tasks/lint-js');
gulpLintJsTasksRegister(gulp);
}
// Lint our code
gulp.task('lint', (callback) => {
// We run the lints using the run-sequence so we won't get all the errors all mixed up with
// each other when we'll have more than 1 lint task
runSequence(['js:lint'], () => {
callback();
});
});
// Runs every time we'll git commit
gulp.task('pre-commit', ['lint']);
// Runs all the tests in the system
gulp.task('tests', ['hooks:tests', 'git-manager:tests']);