-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
45 lines (41 loc) · 1.07 KB
/
Copy pathgulpfile.js
File metadata and controls
45 lines (41 loc) · 1.07 KB
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
/**
* Created by Sumit Patel on 7/3/2016.
*/
var gulp = require('gulp'),
concatify = require('gulp-concat'),
sass=require('gulp-sass'),
minifyCSS = require('gulp-minify-css'),
uglify = require('gulp-uglify'),
browserSync = require('browser-sync').create();
gulp.task('scripts', function() {
gulp.src('src/js/*.js')
.pipe(uglify())
.pipe(concatify('app.js'))
.pipe(gulp.dest('dist/js/'));
});
gulp.task('style', function() {
gulp.src('src/css/*.css')
.pipe(minifyCSS())
.pipe(concatify('app.css'))
.pipe(gulp.dest('dist/css/'));
});
gulp.task('watch', function(){
gulp.watch('src/js/*.js', ['scripts']);
gulp.watch('src/css/*.css', ['style']);
});
gulp.task('serve', function(){
browserSync.init({
server: 'src/'
});
});
gulp.task('serve:dist', function(){
browserSync.init({
server: 'dist/'
});
});
gulp.task('default', ['scripts','style','serve:dist']);
/*gulp.task('default', ['scripts','style'], function () {
browserSync.init({
server: 'dist/'
});
});*/