forked from jessgusclark/gadget-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
38 lines (31 loc) · 1.1 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
var gulp = require('gulp');
var sass = require('gulp-sass');
var concat = require('gulp-concat');
var minifyCSS = require('gulp-minify-css');
var uglify = require('gulp-uglify');
var rename = require("gulp-rename");
//default task:
gulp.task('default', ['sass', 'scripts']);
gulp.task('build', ['sass', 'scripts', 'watch']);
// watchers:
gulp.task('watch', function() {
gulp.watch('source/scss/*.scss', ['sass']);
gulp.watch('source/js/*.js', ['scripts']);
});
gulp.task('sass', function () {
gulp.src(['./bower_components/bootstrap/dist/css/bootstrap.min.css', './source/scss/*.scss'])
.pipe(sass.sync().on('error', sass.logError))
.pipe(concat('gadget.css'))
.pipe(gulp.dest('./build/css/'))
.pipe(minifyCSS())
.pipe(rename("gadget.min.css"))
.pipe(gulp.dest('./build/css/'));
});
gulp.task('scripts', function() {
return gulp.src(['./bower_components/jquery/dist/jquery.js', './source/gadgetlib.js', './source/js/*.js' ])
.pipe(concat('gadget.js'))
.pipe(gulp.dest('./build/js/'))
.pipe(uglify())
.pipe(rename("gadget.min.js"))
.pipe(gulp.dest('./build/js/'));
});