diff --git a/gulpfile.js b/gulpfile.js index ced6d67..c93a426 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -2,7 +2,7 @@ var gulp = require('gulp'); var plugins = require('gulp-load-plugins')({}); var karma = require('karma'); var es = require('event-stream'); -var bowerFiles = require('main-bower-files'); +var mainBowerFiles = require('main-bower-files'); var exists = require('path-exists').sync var pipes = {}; @@ -18,23 +18,30 @@ var paths = { } -pipes.vendorJsFiles = function() { - return gulp.src(bowerFiles({ - overrides : { - jquery : { - main: [] - }, - bootstrap : { - main: [ "dist/**/*.css" ] - } - } - }).map(function(path, index,arr) { - var newPath = path.replace(/.([^.]+)$/g, '.min.$1'); - console.log('path: ' + path + ' newpath:' + newPath + ' exits: ' + exists(newPath) ) - return exists ( newPath ) ? newPath : path; - })) - .pipe(plugins.debug({title: 'vendor-js:'})) -} +var bowerFilesMinified = mainBowerFiles({ + overrides : { + jquery : { + main: [] + }, + bootstrap : { + main: [ "dist/**/*.css" ] + } + } +}).map(function(path, index,arr) { + var newPath = path.replace(/.([^.]+)$/g, '.min.$1'); + return exists ( newPath ) ? newPath : path; +}) + +var bowerFiles = mainBowerFiles({ + overrides : { + jquery : { + main: [] + }, + bootstrap : { + main: [ "dist/**/*.css" ] + } + } +}) pipes.validatedAppScripts = function() { return gulp.src(paths.appFiles) @@ -55,7 +62,7 @@ pipes.validatedPages = function() { } pipes.builtIndexDev = function() { - var vendorFiles = pipes.vendorJsFiles() + var vendorFiles = gulp.src(bowerFilesMinified) .pipe(gulp.dest(paths.distDev + '/vendor')); var appScript = pipes.validatedAppScripts() .pipe(plugins.angularFilesort()) @@ -91,6 +98,4 @@ gulp.task('test', function(done) { }); - - gulp.task('build-dev', pipes.builtIndexDev);