forked from colombia-dev/pataconf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
47 lines (41 loc) · 1.17 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
var gulp = require('gulp'),
sass = require('gulp-sass'),
cssMin = require('gulp-cssmin'),
autoprefixer = require('gulp-autoprefixer'),
browserSync = require('browser-sync').create(),
uglify = require('gulp-uglify'),
concat = require('gulp-concat')
gulp.task('dist-sass', function(cb){
return gulp.src('content/sass/**/*.sass')
.pipe(sass())
.pipe(autoprefixer({
browsers: ['last 40 versions'],
cascade: false
}))
// .pipe(cssMin())
.pipe(gulp.dest('./public/css/'))
.pipe(browserSync.stream())
})
gulp.task('dist-js', function () {
return gulp.src('content/js/**/*.js')
.pipe(concat('main.js'))
.pipe(uglify())
.pipe(gulp.dest('public/js'))
})
gulp.task('watch', function (cb) {
gulp.watch('content/sass/**/*.sass', ['dist-sass'])
gulp.watch('content/js/**/*.js', ['dist-js'])
gulp.watch('*.html').on('change', browserSync.reload)
})
gulp.task('browser-sync', function(cb) {
browserSync.init({
server: {
baseDir: './'
}
})
})
gulp.task('dist', ['dist-sass', 'dist-js'], function(){
console.log('dist ready')
})
gulp.task('default', ['browser-sync', 'dist', 'watch'] , function () {
})