-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
44 lines (37 loc) · 1.08 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
var gulp = require('gulp');
var concat = require('gulp-concat');
var rename = require('gulp-rename');
var uglify = require('gulp-uglify');
var sass = require('gulp-sass');
var prefix = require('gulp-autoprefixer');
var browserSync = require('browser-sync');
gulp.task('first', function(){
return gulp.src('./app/js/**/*.js')
.pipe(concat('min.js'))
.pipe(uglify( {
mangle: false,
output: {
beautify: true
}
}
))
.pipe(rename('uglify.js'))
.pipe(gulp.dest('./prodapp/js/'));
});
gulp.task('sass', function () {
return gulp.src('./app/sass/**/*.sass')
.pipe(sass().on('error', sass.logError))
.pipe(prefix(['last 15 versions'], { cascade: true }))
.pipe(gulp.dest('./prodapp/css/'))
.pipe(browserSync.reload({stream:true}));
});
gulp.task('default', ['first'], function (done) {
console.log('done');
});
gulp.task('serve', ['sass'], function() {
browserSync.init({
server: "./prodapp"
});
gulp.watch("app/sass/*.sass", ['sass']);
gulp.watch("prodapp/**/*.*").on('change', browserSync.reload);
});