-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGulpfile.js
37 lines (32 loc) · 1.2 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
var gulp = require('gulp'),
sass = require('gulp-sass'),
autoprefixer = require('gulp-autoprefixer'),
concatCss = require('gulp-concat-css'),
CleanCSS = require('clean-css'),
map = require('vinyl-map'),
concatJs = require('gulp-concat'),
uglify = require('gulp-uglify');
gulp.task('sass', function () {
var minify = map(function (buff, filename) {
return new CleanCSS({
}).minify(buff.toString()).styles;
});
return gulp.src('./content/themes/pucara/lib/stylesheets/components.sass')
.pipe(sass({optionStyle: "compressed"}).on('error', sass.logError))
.pipe(concatCss('components.css'))
.pipe(autoprefixer({
cascade: true
}))
.pipe(minify)
.pipe(gulp.dest('./content/themes/pucara/assets/css/'));
});
gulp.task('minify:js', function() {
return gulp.src('./content/themes/pucara/lib/js/*.js')
.pipe(uglify())
.pipe(concatJs('app.js'))
.pipe(gulp.dest('./content/themes/pucara/assets/js/min/'));
});
gulp.task('run:developing', function () {
gulp.watch('./content/themes/pucara/lib/stylesheets/**/**/**/*.sass', ['sass']);
gulp.watch('./content/themes/pucara/lib/js/*.js', ['minify:js']);
});