title: gulp plugin - to merge broken js files into one js file?
body: <p>I have read all the answers on the internet that I could find on this subject in last two days. Now I am just searching for gulp plugin that can merge broken js files into one big js file and not to throw error in terminal caused by unclosed function in one js file.</p>
  
  <p>Explanation:</p>
  
  <p>I have created js app built with modules.
  At the very beginning I didn't knew that this will become big app and therefore I have wrote js code in one file.</p>
  
  <p>Now I have come to an idea to split app.js file like this:</p>
  
  <p><strong>app-start.js</strong> (Named IIFE function open)</p>
  
  <p>module1.js</p>
  
  <p>module2.js</p>
  
  <p>etc.</p>
  
  <p><strong>app-end.js</strong>  (Named IIFE function closed)</p>
  
  <p>I am using gulp as task runner and gulp-concat which works perfectly.</p>
  
  <p>Problem is that when I try to break IIFE function in two files (app-start.js, app-end.js) then gulp doesn't wanna build bundle.js file.
  I get error in terminal that I should repair my js code in<br>
  app-start.js</p>
  
  <p>So, my question is,<br>
  do You maybe know about gulp plugin that will merge multiple js files in given order and never mind the js code errors in those files?</p>
  
  <p>This is my gulp.js code:</p>
  
  <pre><code>    var gulp = require('gulp'),
      sass = require('gulp-sass'),
      uglify = require('gulp-uglify'),
      plumber = require('gulp-plumber'),
      concat = require('gulp-concat'),
      imagemin = require('gulp-imagemin'),
      pngquant = require('imagemin-pngquant'),
      autoprefixer = require('gulp-autoprefixer'),
      browserSync = require('browser-sync').create(),
      sourceMap = require('gulp-sourcemaps'),
      babel = require('gulp-babel');
  
  
  
      gulp.task('sass', function() {
      gulp.src('resources/sass/config-normalize.sass')
      //.pipe(sourceMap.init())
      .pipe(sass.sync().on('error', sass.logError))
      .pipe(autoprefixer({browsers: ['last 30 versions']}))
      .pipe(sass({outputStyle: 'expanded'})) //expanded - compressed  
      //.pipe(sourceMap.write('.'))
      .pipe(gulp.dest('configurator/css'));
  
      gulp.src('resources/sass/config-style.sass')
      //.pipe(sourceMap.init())
      .pipe(sass.sync().on('error', sass.logError))
      .pipe(autoprefixer({browsers: ['last 30 versions']}))
      .pipe(sass({outputStyle: 'expanded'})) //expanded - compressed  
      //.pipe(sourceMap.write('.'))
      .pipe(gulp.dest('configurator/css'))
      .pipe(browserSync.stream());
  });
  
  
  gulp.task('scripts', function() {
      gulp.src([
          //'resources/js/vendor/jquery.js',
          //'resources/js/vendor/library/neki_file.js',
          'resources/js/001-app-start.js',          
          'resources/js/002-ajax.js',
          'resources/js/003-global-variables.js',
  
          'resources/js/050-main.js',
  
          'resources/js/100-my-modules.js',
          'resources/js/app-end.js'
          ])
      //.pipe(plumber())
      .pipe(babel({
              presets: ['es2015']
          }))
      .pipe(concat('all.js'))
      //.pipe(uglify())
      .pipe(gulp.dest('configurator/js'))
      .pipe(browserSync.stream());
  });
  
  
  
  gulp.task('php', function() {
      gulp.src('./**/*.php')
      .pipe(browserSync.stream());
  });
  
  
  
  
  gulp.task('browser-sync', function() {
      browserSync.init({
          proxy: "localhost"     //Upisi path do projekta na local hostu bez http://
      });
  });
  
  
  
  
  gulp.task('images', function() {
      return gulp.src('assets/images-uncompressed/**/*')
          .pipe(imagemin({
              progressive: true,
              svgoPlugins: [{removeViewBox: false}],
              use: [pngquant()]
          }))
          .pipe(gulp.dest('build/images'));
  });
  
  
  
  gulp.task('watch', function() {
      gulp.watch('./**/*.php', ['php']);
      gulp.watch('resources/sass/**', ['sass']);
      gulp.watch('resources/js/**', ['scripts']);
      //gulp.watch('resources/images-uncompressed/*', ['images']);
  });
  
  gulp.task('default', ['sass', 'scripts', 'php', 'browser-sync', 'watch']);
  </code></pre>