-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
49 lines (43 loc) · 1.32 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
var gulp = require('gulp'),
sass = require('gulp-sass'),
autoprefixer = require('gulp-autoprefixer'),
notify = require('gulp-notify'),
uglify = require('gulp-uglify'),
rename = require('gulp-rename');
gulp.task('stylesheet', function(){
return gulp.src('./source/stylesheet/**/*.scss')
.pipe(sass({outputStyle: 'compressed'}))
.on('error',notify.onError({
title: 'STYLESHEET ERRROR!',
message: '<%= error.message %>'
}))
.pipe(autoprefixer({browsers: ["> 0%"]}))
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest('./dist/css/'));
});
gulp.task('script', function(){
return gulp.src('./source/script/**/*.js')
.pipe(uglify())
.on('error',notify.onError({
title: 'SCRIPT ERRROR!',
message: '<%= error.message %>'
}))
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest('./dist/js/'));
});
gulp.task('move-fonts', function(){
return gulp.src('./source/libs/components-font-awesome/fonts/**')
.pipe(gulp.dest('./dist/fonts/'))
});
gulp.task('build-js', function(){
return gulp.src([
'./source/libs/jquery/dist/jquery.min.js',
'./source/libs/jquery.mobile/jquery.mobile.custom.min.js'
])
.pipe(gulp.dest('./dist/js/libs'))
});
gulp.task('watch', function(){
gulp.watch('./source/stylesheet/**/*.scss', ['stylesheet']);
gulp.watch('./source/script/**/*.js', ['script']);
});
gulp.task('default', ['watch'], function(){});