-
Notifications
You must be signed in to change notification settings - Fork 2
/
gulpfile.js
51 lines (43 loc) · 1.41 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
var gulp = require('gulp'),
sass = require ('gulp-sass'),
notify = require('gulp-notify'),
mainBowerFiles = require('main-bower-files'),
filter = require('gulp-filter'),
autoprefixer = require('gulp-autoprefixer'),
concat = require('gulp-concat'),
uglify = require('gulp-uglify');
var config = {
stylesPath: 'assets/styles',
jsPath: 'assets/scripts',
bowerDir: 'bower_components'
,
outputDir: 'public'
}
gulp.task('js', function() {
return gulp.src(mainBowerFiles().concat(config.jsPath+'/*'))
.pipe(filter('**/*.js'))
.pipe(concat('main.js'))
.pipe(uglify())
.pipe(gulp.dest(config.outputDir + '/js'));
});
gulp.task('icons', function() {
return gulp.src(config.bowerDir + '/font-awesome/fonts/**.*')
.pipe(gulp.dest(config.outputDir + '/fonts'));
});
gulp.task('css', function() {
return gulp.src(config.stylesPath + '/main.scss')
.pipe(sass({
outputStyle: 'compressed',
includePaths: [
config.stylesPath,
config.bowerDir + '/bootstrap-sass/assets/stylesheets',
config.bowerDir + '/font-awesome/scss'
]
}).on('error', sass.logError))
.pipe(autoprefixer())
.pipe(gulp.dest(config.outputDir + '/css'));
});
gulp.task('watch', function(){
gulp.watch([config.stylesPath + '**/*.scss', config.stylesPath + '**/*.sass', config.stylesPath + '**/*.css'], ['css']);
gulp.watch([config.jsPath + '**/*.js'], ['js']);
})
gulp.task('default', ['js', 'css', 'icons']);