-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
50 lines (44 loc) · 1.65 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
var gulp = require('gulp'),
less = require('gulp-less'),
autoprefixer = require('gulp-autoprefixer'),
rename = require('gulp-rename'),
minify = require('gulp-minify'),
cssnano = require('gulp-cssnano');
gulp.task('styles', function() {
return gulp.src('./Assets/dev/less/main.less')
.pipe(less())
.pipe(autoprefixer('last 4 version'))
.pipe(gulp.dest('./Assets/build/css/'))
.pipe(rename({ suffix: '.min' }))
.pipe(cssnano())
.pipe(gulp.dest('./Assets/build/css/'));
});
gulp.task('imgs', function(){
return gulp.src('./Assets/dev/imgs/*.*')
.pipe(gulp.dest('./Assets/build/imgs'));
});
gulp.task('js', function(){
return gulp.src('./Assets/dev/js/*.js')
.pipe(minify({
ext:{
src:'-debug.js',
min:'.min.js'
}
}))
.pipe(gulp.dest('./Assets/build/js'));
});
gulp.task('header', function(){
console.log('|------------------------------------------------------|');
console.log('| |');
console.log('| SKIING TEMPLATE ASSETS BUILDING |');
console.log('| Commands : styles, imgs, js, build, watch |');
console.log('| Made with <3 by lucas-trebouet.fr |');
console.log('| |');
console.log('|------------------------------------------------------|');
});
gulp.task('build', ['header', 'styles', 'imgs', 'js']);
gulp.task('watch', ['build'], function() {
gulp.watch('./Assets/dev/less/main.less', ['styles']);
gulp.watch('./Assets/dev/imgs/*.*', ['imgs']);
gulp.watch('./Assets/dev/js/*.js', ['js']);
});