-
Notifications
You must be signed in to change notification settings - Fork 28
/
gulpfile.js
64 lines (52 loc) · 2.61 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
'use strict';
const gulp = require('gulp');
const runSequence = require('run-sequence');
const browserSync = require('./core/tasks/browser-sync');
const bundle = require('./core/tasks/bundle');
const templates = require('./core/tasks/templates');
const copy = require('./core/tasks/copy');
const watch = require('./core/tasks/watch');
const server = require('./core/tasks/server');
const iconFont = require('./core/tasks/icon-font');
// Configs
const config = require('./core/discovery/config');
// Sass is used to render core templates so is needed, even if you use postcss in your content part
const sass = require('./core/tasks/sass');
const postcss = require('./core/tasks/postcss');
// Optional tasks: Purge CSS and minify CSS
const purge = require('./core/tasks/purge');
const minifyCSS = require('./core/tasks/minify-css');
// Execute this task instead of optional tasks
const dummy = require('./core/tasks/dummy');
gulp.task('templates:clean', templates.clean);
gulp.task('sass', sass);
gulp.task('postcss', postcss);
gulp.task('minifyCSS', minifyCSS);
gulp.task('purgeCSS', purge);
gulp.task('server', server);
gulp.task('dummy', dummy);
gulp.task('copy:images', copy.images);
gulp.task('copy:fonts', copy.fonts);
gulp.task('copy:favicon', copy.favicon);
gulp.task('copy:resources', copy.resources);
gulp.task('copy:scripts', copy.scripts);
gulp.task('copy:compiledToDist', copy.compiledToDist);
gulp.task('bundle:clientBundle', bundle.clientBundle);
gulp.task('bundle:prototypeBundle', bundle.prototypeBundle);
gulp.task('icon-font', iconFont);
gulp.task('templates:compile:content', templates.compile.content);
gulp.task('templates:compile:styleguide', templates.compile.styleguide);
gulp.task('templates:compile:docs', templates.compile.docs);
gulp.task('templates:compile', config.styleguide ?
gulp.parallel('templates:compile:content', 'templates:compile:styleguide', 'templates:compile:docs') :
gulp.series('templates:compile:content')
);
gulp.task('watch', watch);
gulp.task('copy', gulp.parallel('copy:images', 'copy:fonts', 'copy:resources', 'copy:scripts', 'copy:favicon'));
gulp.task('compile-all', gulp.parallel('templates:clean', 'icon-font', 'bundle:clientBundle', 'bundle:prototypeBundle', 'sass', 'postcss', 'copy'));
gulp.task('build', gulp.series('compile-all', 'templates:compile', 'copy:compiledToDist', config.css.purge ? 'purgeCSS' : 'dummy', config.css.minify ? 'minifyCSS': 'dummy'), function (done) {
console.log('------------\n');
console.log('Build finished. Compiled files can be found in the dist/ directory.');
process.exit(0);
});
gulp.task('default', gulp.parallel('server', 'compile-all', 'watch', browserSync));