-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
50 lines (43 loc) · 1.4 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
var gulp = require('gulp');
var minifyCSS = require('gulp-clean-css');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var imagemin = require('gulp-imagemin');
var rename = require('gulp-rename');
var sass = require('gulp-sass');
//Change Folder paths
gulp.task('styles',function(){
var stylesSrc = [
'./styles/development/scss/**/*.scss'
];
return gulp.src(stylesSrc)
.pipe(sass())
.pipe(concat('dev.css'))
.pipe(gulp.dest('./styles/production/'))
.pipe(rename('prod.min.css'))
.pipe(minifyCSS())
.pipe(gulp.dest('./styles/production/'));
});
gulp.task('scripts',function(){
var scriptSrc =[
'./js/development/vendor/**/*.js',
'./js/development/foundation/**/*.js',
'./js/development/app.js'
];
gulp.src(scriptSrc)
.pipe(concat('dev.js'))
.pipe(gulp.dest('./js/production/'))
.pipe(rename('prod.min.js')
.pipe(uglify())
.pipe(gulp.dest('./js/production/'));
});
gulp.task('images',function(){
return gulp.src('./images/*')
.pipe(imagemin())
.pipe(gulp.dest('./images'));
});
gulp.task('watch', function() {
gulp.watch('./styles/development/**/*.scss', ['styles']);
gulp.watch('./js/development/**/*.js', ['scripts']);
});
gulp.task('default', ['styles','scripts','images']);