title: Concatenated files put into main.js just keeps stacking instead of clearing the file then adding the code
body: <p>I'm trying to compile all my scripts into a single <code>main.js</code> file which I can then link to my index file. Problem is that all my script files are being concatenated and then just <strong>added</strong> to the <code>main.js</code> file, so if I save 3 times, I will basically have 3 copies of all my scripts concatenated and put in the <code>main.js</code> file. </p>
  
  <p>I would like to either delete the <code>main.js</code> file each time I save and then run the concatenation, or just clean the file before adding the contents. Now if I try to delete the file using the <code>del</code> module, I receive an error stating that I can't delete files out of the working directory without forcing this action. I would like to avoid forcing this if possible. </p>
  
  <p>I feel that there must be a more elegant way of doing this.. </p>
  
  <p>Here's my script task:</p>
  
  <pre><code>// Concat and compile our JS into a minified dist file
  gulp.task('scripts', function() {
    return gulp.src('../app/public/assets/scripts/**/*.js')
      .pipe(jshint())
      .pipe(jshint.reporter('default'))
      .pipe(concat('main.js'))
      //.pipe(del(['../app/public/assets/scripts/main.js'])) &lt;-- Doesn't work without forcing
      .pipe(gulp.dest('../app/public/assets/scripts'))
      .pipe(gulpif(flags.build, gulp.dest('../app/dist/assets/scripts')))
      .pipe(rename({ suffix: '.min' }))
      .pipe(uglify())
      .pipe(gulpif(flags.build, gulp.dest('../app/dist/assets/scripts')))
      .pipe(notify({ message: 'Finished compiling scripts' }));
  });
  </code></pre>