-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
60 lines (46 loc) · 1.46 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
/*******************************
* Set-up
*******************************/
const
gulp = require('gulp'),
// read user config to know what task to load
config = require('./assets/semantic/tasks/config/user')
;
/*******************************
* Tasks
*******************************/
require('./assets/semantic/tasks/collections/build')(gulp);
require('./assets/semantic/tasks/collections/various')(gulp);
require('./assets/semantic/tasks/collections/install')(gulp);
gulp.task('default', gulp.series('watch'));
/*--------------
Docs
---------------*/
require('./assets/semantic/tasks/collections/docs')(gulp);
/*--------------
RTL
---------------*/
if (config.rtl) {
require('./assets/semantic/tasks/collections/rtl')(gulp);
}
/*--------------
Custom
---------------*/
// Minify custom CSS/JS elements
gulp.task('minify', function (done) {
const minify = require('gulp-clean-css');
const uglify = require('gulp-uglify');
const rename = require('gulp-rename');
const tasks = require('./assets/semantic/tasks/config/tasks');
gulp.src(['css/*.css','!css/*.min.css'],{cwd: './assets/'})
.pipe(minify({inline: ['local', 'remote', '!fonts.googleapis.com']}))
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest('./assets/css/'))
;
gulp.src(['js/*.js','!js/*.min.js'],{cwd: './assets/'})
.pipe(uglify(tasks.settings.uglify))
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest('./assets/js/'))
;
done();
});