ionic-team / ionic-gulp-tasks

Collection of gulp tasks for building Ionic apps
41 stars 33 forks source link

scripts-copy: make defaults visible? #36

Open daixtrose opened 8 years ago

daixtrose commented 8 years ago

In the gulp task for scripts-copy defaulSrc is invisible for the user. This makes it impossible to concatenate own sources to the function by calling

copyScripts({
  src: copyScripts.defaultSrc.concat([
      ... // my files here
  ])
});

I propose to change the code to allow it, if this does not stand against gulp rules, something along these lines:

var gulp = require('gulp');

module.exports = function(options) {
  var defaultSrc = [
    'node_modules/es6-shim/es6-shim.min.js',
    'node_modules/es6-shim/es6-shim.map',
    'node_modules/zone.js/dist/zone.js',
    'node_modules/reflect-metadata/Reflect.js',
    'node_modules/reflect-metadata/Reflect.js.map'
   ];

options.src = options.src || defaultSrc;
options.dest = options.dest || 'www/build/js';

return gulp.src(options.src)
    .pipe(gulp.dest(options.dest));
}

What do you think?