-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
executable file
·63 lines (49 loc) · 1.38 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
51
52
53
54
55
56
57
58
59
60
61
62
63
var gulp = require('gulp');
var concat = require('gulp-concat');
var sass = require('gulp-sass');
var watch = require('gulp-watch');
var plumber = require('gulp-plumber');
// Default build
gulp.task('build', ['sass','js_app', 'js_libs']);
// Watch changments
gulp.task('default', function() {
gulp.watch( 'js/**/*.js', ['js_app']);
gulp.watch( 'sass/**/*.scss', ['sass']);
gulp.watch( 'js/vendor/*.js', ['js_libs']);
});
// App
gulp.task('js_app', function() {
return gulp.src(['js/*.js', 'js/views/*.js'])
.pipe(plumber({
errorHandler: function (error) {
console.log(error.message);
this.emit('end');
}}))
.pipe(concat("app.js"))
.pipe(gulp.dest( 'dist/js/' ))
});
// Sass
gulp.task('sass', function()
{
return gulp.src( 'sass/**/*.scss' )
.pipe(plumber({
errorHandler: function (error) {
console.log(error.message);
this.emit('end');
}}))
.pipe(sass({
indentedSyntax: false
}))
.pipe(gulp.dest( 'dist/css/' ))
});
// Vendors
gulp.task('js_libs', function() {
return gulp.src('js/vendors/*.js')
.pipe(plumber({
errorHandler: function (error) {
console.log(error.message);
this.emit('end');
}}))
.pipe(concat("vendors.js"))
.pipe(gulp.dest('dist/js/'))
});