{"size": 1436, "ext": "js", "max_stars_repo_path": "gulpfile.js", "max_stars_repo_name": "bartoszkrawczyk2/vunits.js", "max_stars_repo_stars_event_min_datetime": "2015-09-14T10:22:16.000Z", "max_stars_repo_stars_event_max_datetime": "2015-09-14T10:22:16.000Z", "max_issues_repo_path": "gulpfile.js", "max_issues_repo_name": "bartoszkrawczyk2/vunits.js", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "gulpfile.js", "max_forks_repo_name": "bartoszkrawczyk2/vunits.js", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 24.3389830508, "max_line_length": 54, "alphanum_fraction": 0.5034818942}
var gulp       = require('gulp'),
    jsmin      = require('gulp-uglify'),
    sass       = require('gulp-sass'),
    sourcemaps = require('gulp-sourcemaps'),
    gutil      = require('gulp-util'),
    cssmin     = require('gulp-minify-css'),
    prefixer   = require('gulp-autoprefixer'),
    rename     = require('gulp-rename'),
    connect    = require('gulp-connect');

gulp.task('js', function() {
    gulp.src('./src/vunits.js')
        .pipe(jsmin({
                preserveComments: 'some'
            }).on('error', gutil.log))
        .pipe(rename({
            suffix: ".min"
        }))
        .pipe(gulp.dest('./dist'))
        .pipe(gulp.dest('./demo/js'))
});

gulp.task('styles', function() {
    gulp.src('./demo/scss/**/*.scss')
        .pipe(sourcemaps.init())
        .pipe(sass({errLogToConsole: true}))
        .pipe(prefixer({
            browsers: ['last 35 versions']
        }))
        .pipe(cssmin())
        .pipe(sourcemaps.write())
        .pipe(gulp.dest('./demo/css'));
});


gulp.task('build', [
    'js',
    'styles'
]);

gulp.task('server', function() {
    connect.server({
        root: './demo/',
        port: 8081
    });
});

gulp.task('watch', function() {
    gulp.watch(['./src/vunits.js'], function() {
        gulp.start('js');
    });

    gulp.watch(['./demo/scss/**/*.scss'], function() {
        gulp.start('styles');
    });

});

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