title: Including bootstrap js with gulp causing errors
body: <p>I have successfully got all my scss including bootstraps to combine into one minified file using gulp. Now I am trying to do the same with my js and bootstraps. The problem is that uglify keeps throwing errors at me like Unexpected token: name ($) etc. And won't minify / compile bootstrap js because of this. Now I'm starting to believe I am going the wrong way about this. </p>
  
  <p>This is my file structure: </p>
  
  <p>app/js(my.js files in here)/vendor/bootstrap/js/src/(boostrap js files here)</p>
  
  <p>As you can see, what I have done is just copy the bootstrap js files into my files in the hope that they would be minified / compiled along with mine. But with the scss I imported the files like you usually do. So am I doing this the wrong way? </p>
  
  <p>here's my gulp.js code</p>
  
  <pre><code>var gulp = require('gulp');
  var sass = require('gulp-sass');
  var cleanCss = require('gulp-clean-css');
  var rename = require('gulp-rename'); 
  var uglify = require('gulp-uglify');
  var gulpSequence = require('gulp-sequence');
  var autoPrefixer = require('gulp-autoprefixer');
  var concat = require('gulp-concat');
  var jshint = require('gulp-jshint');
  var csslint = require('gulp-csslint');
  var htmlReporter = require('gulp-csslint-report');
  var plumber = require('gulp-plumber');
  var sourcemaps = require('gulp-sourcemaps');
  
  //plumber error 
  var onError = function (err) {
    console.log(err);
  };
  
  //create sourcemaps, convert scss to css, lint check, minify and prefix
  gulp.task('css', function(){
      return gulp.src('app/scss/**/*.scss')
          .pipe(plumber({
            errorHandler: onError
          }))
          .pipe(sourcemaps.init())
          .pipe(sass())
          .pipe(csslint())
          .pipe(htmlReporter())
          .pipe(cleanCss())
          .pipe(rename({
              suffix: '.min'
          }))
          .pipe(autoPrefixer({
              browsers: ['last 3 versions'],
              cascade: false
          }))
          .pipe(sourcemaps.write('.'))
          .pipe(gulp.dest('dist/css'))
  });
  
  
  //create sourcemaps, lint check, compile into one file, minify
  gulp.task('js', function() {
    return gulp.src('app/js/**/*.js')
      .pipe(plumber({
          errorHandler: onError
      }))
      .pipe(sourcemaps.init())
      .pipe(jshint())
      .pipe(jshint.reporter('gulp-jshint-html-reporter', {
          filename: __dirname + '/jshint-output.html',
          createMissingFolders : false  
      }))
      .pipe(concat('all.js'))
      .pipe(uglify())
      .pipe(rename({
          suffix: '.min'
      }))
      .pipe(sourcemaps.write('.'))
      .pipe(gulp.dest('dist/js'))
  });                                                                            
  
  //copy php files to app
  gulp.task('phpCopy', function(){
      return gulp.src('app/*.php')
          .pipe(plumber({
            errorHandler: onError
          }))
          .pipe(gulp.dest('dist'));
  });
  
  //functions to run on file save
  gulp.task('watch', function(){
      gulp.watch('app/scss/**/*.scss', ['css']);
      gulp.watch('app/*.php', ['phpCopy']);
      gulp.watch('app/js/**/*.js', ['js']);
  });
  
  gulp.task('default', ['css', 'js', 'phpCopy']);
  </code></pre>