-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
35 lines (31 loc) · 904 Bytes
/
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
var gulp = require('gulp');
var sass = require('gulp-sass');
var concat = require('gulp-concat');
var notify = require('gulp-notify');
var cssnano = require('gulp-cssnano');
var sourcemaps = require('gulp-sourcemaps');
gulp.task('bootstrap', function() {
return gulp.src('./node_modules/bootstrap/scss/**/**')
.pipe(gulp.dest(('src/scss/bootstrap/')));
});
gulp.task('scss', function () {
gulp.src('src/scss/*.scss')
.pipe(sourcemaps.init())
.pipe(sass())
.on('error', notify.onError({
message: "Erro: <%= error.message %>",
title: "Sass Error"
}))
.pipe(cssnano())
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('dist/css/'));
});
gulp.task('js', function(){
return gulp.src('src/js/*.js')
.pipe(concat('bundle.js'))
.pipe(gulp.dest('dist/js'))
});
gulp.task('listen', function() {
gulp.watch('src/scss/**/*.scss', ['scss']);
gulp.watch('src/js/*.js', ['js']);
});