forked from themeselection/bootstrap-cheatsheet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
63 lines (48 loc) · 1.77 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
// Require the modules.
var gulp = require('gulp');
var gutil = require('gulp-util');
// var minimist = require('minimist');
var config = require('./config.json');
// var options = minimist(process.argv.slice(2));
// global.myLayout = options.Layout;
global.config = config;
global.pugSrc = ['*.pug', '!**/template.pug'];
gutil.log(gutil.colors.green('Starting Gulp!!'));
const autoPrefixTasks = require('./gulp-tasks/autoprefix')(gulp);
const beautifyTasks = require('./gulp-tasks/beautify')(gulp);
const cleanTasks = require('./gulp-tasks/clean')(gulp);
const copyTask = require('./gulp-tasks/copy')(gulp);
const cssTasks = require('./gulp-tasks/css')(gulp);
const pugTasks = require('./gulp-tasks/pug')(gulp);
const replaceTasks = require('./gulp-tasks/replace')(gulp);
const scssTasks = require('./gulp-tasks/scss')(gulp);
const uglifyTasks = require('./gulp-tasks/uglify')(gulp);
// Clean CSS & JS
gulp.task('dist-clean', cleanTasks.css, cleanTasks.js);
// Create CSS from SCSS
gulp.task(
'dist-css',
gulp.series(
cleanTasks.css,
scssTasks.pages,
autoPrefixTasks.css,
cssTasks.css_comb,
cssTasks.css_min
)
);
// Dist JS
gulp.task('dist-js', gulp.series(cleanTasks.js, copyTask.js, uglifyTasks.js));
// Dist HTML
gulp.task(
'dist-html',
gulp.series(cleanTasks.html, pugTasks.html)
);
// Monitor Changes
gulp.task('monitor', gulp.series(gulp.parallel(pugTasks.watch, scssTasks.watch)));
// Beautify HTML
gulp.task('beautify-html', gulp.series(beautifyTasks.html));
// Replacement Tasks
gulp.task('replacement', gulp.series(replaceTasks.css, replaceTasks.js));
// Default / Basic tasks
gulp.task('dist', gulp.parallel('dist-clean', 'dist-css', 'dist-js', 'dist-html', 'beautify-html', 'replacement'));
gulp.task('default', gulp.parallel('dist-css', 'dist-js'));