const conf = require('./gulp.conf');
const wiredep = require('wiredep');

module.exports = function listFiles() {
  const wiredepOptions = Object.assign({}, conf.wiredep, {
<% if (framework === 'react') { -%>
    overrides: {
      react: { main: [ 'react-with-addons.js' ] }
    },
<% } -%>
    dependencies: true,
    devDependencies: true
  });

  const patterns = [
    ...wiredep(wiredepOptions).js,
<% if (framework === 'angular1') { -%>
    conf.path.tmp('**/*.js'),
    conf.path.src('**/*.html')
<% } -%>
<% if (framework === 'react') { -%>
    conf.path.tmp('app/**/*.js')
<% } -%>
  ];

  var files = patterns.map(pattern => ({ pattern: pattern }));
  files.push({
    pattern: conf.path.src('assets/**/*'),
    included: false,
    served: true,
    watched: false
  });
  return files;
}

@@ -365,17 +365,8 @@
 s = 
-%5B%0A    ...
 wire
@@ -387,17 +387,25 @@
 ions).js
-,
+.concat(%5B
 %0A%3C%25 if (

Remove array spread for node v4 compatibility