Better build error handling for uglify and sass
This commit is contained in:
parent
8db872fa98
commit
df1b47cee5
@ -1,7 +1,7 @@
|
||||
var gulp = require('gulp'),
|
||||
plugins = require("gulp-load-plugins")();
|
||||
|
||||
paths = {
|
||||
var paths = {
|
||||
view: [
|
||||
'bower_components/jQuery/dist/jquery.min.js',
|
||||
'bower_components/js-md5/js/md5.min.js',
|
||||
@ -23,7 +23,14 @@ paths = {
|
||||
]
|
||||
}
|
||||
|
||||
gulp.task('view', function () {
|
||||
var catchError = function(err) {
|
||||
|
||||
console.log(err.toString());
|
||||
this.emit('end');
|
||||
|
||||
}
|
||||
|
||||
gulp.task('view', function() {
|
||||
|
||||
gulp.src(paths.view)
|
||||
.pipe(plugins.concat('view.js', {newLine: "\n"}))
|
||||
@ -32,19 +39,21 @@ gulp.task('view', function () {
|
||||
|
||||
});
|
||||
|
||||
gulp.task('js', function () {
|
||||
gulp.task('js', function() {
|
||||
|
||||
gulp.src(paths.js)
|
||||
.pipe(plugins.concat('main.js', {newLine: "\n"}))
|
||||
.pipe(plugins.uglify())
|
||||
.on('error', catchError)
|
||||
.pipe(gulp.dest('../assets/min/'));
|
||||
|
||||
});
|
||||
|
||||
gulp.task('css', function () {
|
||||
gulp.task('css', function() {
|
||||
|
||||
gulp.src(paths.css)
|
||||
.pipe(plugins.sass())
|
||||
.on('error', catchError)
|
||||
.pipe(plugins.concat('main.css', {newLine: "\n"}))
|
||||
.pipe(plugins.autoprefixer('last 4 versions', '> 5%'))
|
||||
.pipe(plugins.minifyCss())
|
||||
|
Loading…
Reference in New Issue
Block a user