Skip to content

Instantly share code, notes, and snippets.

@thomastuts
Created October 14, 2014 08:06
Show Gist options
  • Save thomastuts/e7c6b8c867c89e533973 to your computer and use it in GitHub Desktop.
Save thomastuts/e7c6b8c867c89e533973 to your computer and use it in GitHub Desktop.
var gulp = require('gulp');
var path = require('path');
var paths = require('./paths');
var concat = require('gulp-concat');
var sourceMaps = require('gulp-sourcemaps');
var mainBowerFiles = require('main-bower-files');
var sourceOrdered = [
'!' + path.join(paths.scripts, 'bundle.js'),
'!' + path.join(paths.scripts, 'vendor.js'),
path.join(paths.scripts, 'app.js'),
path.join(paths.scripts, '**/*module*.js'),
path.join(paths.scripts, '**/*.js')
];
module.exports = {
source: function () {
return gulp.src(sourceOrdered)
.pipe(sourceMaps.init())
.pipe(concat('bundle.js'))
.pipe(sourceMaps.write())
.pipe(gulp.dest(paths.scripts));
},
vendor: function () {
var vendorFiles = mainBowerFiles();
console.log(vendorFiles);
return gulp.src(vendorFiles)
.pipe(concat('vendor.js'))
.pipe(gulp.dest(paths.scripts));
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment