-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
45 lines (39 loc) · 1.18 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
var gulp = require('gulp'),
gutil = require('gulp-util'),
uglify = require('gulp-uglify'),
sass = require('gulp-sass'),
cssmin = require('gulp-cssmin'),
concat = require('gulp-concat'),
autoprefixer = require('gulp-autoprefixer'),
sass = require('gulp-sass'),
concat = require('gulp-concat'),
minifyCSS = require('gulp-minify-css'),
rename = require('gulp-rename');
gulp.task('build-js', function () {
gulp.src(['./js/jquery.js', './js/**/*.js'])
.pipe(concat('virtuoso.js'))
.pipe(gulp.dest('./dist/'))
.pipe(uglify())
.pipe(rename('virtuoso.min.js'))
.pipe(gulp.dest('./dist/'));
});
gulp.task('watch-js', function() {
gulp.watch(['./js/**/*.js'], ['build-js']);
});
gulp.task('build-sass', function () {
gulp.src('stylesheets/**/*.scss')
.pipe(sass())
.pipe(autoprefixer({
browsers: ['last 3 versions'],
cascade: false}))
.pipe(gulp.dest('./dist/'))
.pipe(minifyCSS())
.pipe(rename({
suffix: '.min'
}))
.pipe(gulp.dest('./dist/'))
});
gulp.task('watch-sass', function() {
gulp.watch(['./stylesheets/**/*.scss'], ['build-sass']);
});
gulp.task('default', ['build-js', 'watch-js', 'build-sass', 'watch-sass']);