{"size": 1102, "ext": "js", "max_stars_repo_path": "gulpfile.js", "max_stars_repo_name": "CodeCorico/ractive-require", "max_stars_repo_stars_event_min_datetime": "2015-10-22T08:22:48.000Z", "max_stars_repo_stars_event_max_datetime": "2017-10-28T15:34:07.000Z", "max_issues_repo_path": "gulpfile.js", "max_issues_repo_name": "CodeCorico/ractive-require", "max_issues_repo_issues_event_min_datetime": "2015-10-21T23:43:36.000Z", "max_issues_repo_issues_event_max_datetime": "2016-10-24T10:27:09.000Z", "max_forks_repo_path": "gulpfile.js", "max_forks_repo_name": "XavierBoubert/ractive-require", "max_forks_repo_forks_event_min_datetime": "2015-10-08T08:01:28.000Z", "max_forks_repo_forks_event_max_datetime": "2016-05-31T09:23:35.000Z"}
{"max_stars_count": 15, "max_issues_count": 10, "max_forks_count": 4, "avg_line_length": 26.8780487805, "max_line_length": 170, "alphanum_fraction": 0.5780399274}
'use strict';

var gulp = require('gulp'),
    concat = require('gulp-concat'),
    uglify = require('gulp-uglifyjs'),
    insert = require('gulp-insert'),
    packagejson = require('./package.json'),
    header = '/*! Ractive-Require (' + packagejson.version + '). (C) ' + new Date().getFullYear() + ' CodeCorico. MIT @license: en.wikipedia.org/wiki/MIT_License */\r\n',
    files = [
      'features/get/get.js',
      'features/controller/controller.js',
      'features/require/require.js'
    ];

gulp.task('default', ['build', 'watch']);

gulp.task('build', function() {
  gulp
    .src(files)
    .pipe(concat('ractive-require.js', {
      newLine: '\r\n'
    }))
    .pipe(insert.prepend(header))
    .pipe(gulp.dest('./dist'))
    .pipe(uglify('ractive-require.min.js', {
      outSourceMap: true
    }))
    .pipe(insert.transform(function(contents) {
      if (contents.substr(0, 1) != '{') {
        contents = header + contents;
      }

      return contents;
    }))
    .pipe(gulp.dest('./dist'));
});

gulp.task('watch', function() {
  gulp.watch('./features/**/*.js', ['build']);
});
