-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
53 lines (50 loc) · 1.35 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
var gulp = require('gulp')
var sass = require('gulp-sass')
var babel = require('gulp-babel')
var browserSync = require('browser-sync')
gulp.task('sass', function() {
return gulp.src('app/scss/**/*.+(scss|sass)')
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest('app/css'))
.pipe(browserSync.reload({
stream: true
}))
})
gulp.task('images', function(){
return gulp.src('app/images/**/*.+(png|jpg|jpeg|gif|svg)')
.pipe(gulp.dest('dist/images'))
})
gulp.task('css',['sass'], function(){
return gulp.src('app/css/**/*.css')
.pipe(gulp.dest('dist/css'))
})
gulp.task('html', function(){
return gulp.src('app/*.html')
.pipe(gulp.dest('dist'))
})
gulp.task('js', function() {
return gulp.src('app/js/**/*.js')
.pipe(babel({
presets: ['es2015']
}))
.pipe(gulp.dest('dist/js'));
})
gulp.task('browserSync', function() {
browserSync({
server: {
baseDir: 'app'
},
})
})
gulp.task('watch', ['browserSync', 'sass'], function(){
gulp.watch('app/scss/**/*.+(scss|sass)', ['sass'])
gulp.watch('app/*.html', browserSync.reload)
gulp.watch('app/js/**/*.js', browserSync.reload)
})
gulp.task('fonts', function() {
return gulp.src('app/fonts/**/*')
.pipe(gulp.dest('dist/fonts'))
})
gulp.task('build',['css','fonts','html','js','images'] , function() {
console.log('Building Dude, I\'m Building dude ... ');
})