From 60d6c5f3e46b887806e252d5dea1f04715a81e0d Mon Sep 17 00:00:00 2001 From: Victor Häggqvist Date: Sat, 16 Jan 2016 22:00:36 +0100 Subject: write some docs and fixup demo --- gulpfile.js | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) (limited to 'gulpfile.js') diff --git a/gulpfile.js b/gulpfile.js index c081b81..8fb1871 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -8,6 +8,7 @@ var csso = require('gulp-csso'); var size = require('gulp-size'); var uglify = require('gulp-uglify'); var webpack = require('webpack-stream'); +var concat = require('gulp-concat'); gulp.task('style', function () { return gulp.src('./style/touch-imagelightbox.scss') @@ -50,11 +51,39 @@ gulp.task('pack', function() { .pipe(gulp.dest('./demo')); }); -gulp.task('default', ['pack']); - gulp.task('watch', function () { webpackOptions.watch = true; gulp.src('') .pipe(webpack(webpackOptions)) .pipe(gulp.dest('./demo')); }); + +gulp.task('lint', function() { + return gulp.src('./src/**/*.js') + .pipe(eslint()) + .pipe(eslint.format()) + .pipe(eslint.failAfterError()); +}); + + +gulp.task('uglify', ['pack'], function() { + return gulp.src('./demo/LightBox.*.js') + .pipe(uglify()) + .pipe(gulp.dest('dist')); +}); + +gulp.task('buildjs', ['uglify'], function() { + return gulp.src(['./dist/LightBox.*.js', '!./dist/LightBox.Core.js', '!./dist/LightBox.Plugins.js']) + .pipe(concat('LightBox.Plugins.js')) + .pipe(gulp.dest('./dist')); +}); + +gulp.task('csso', ['style'], function() { + return gulp.src('./demo/touch-imagelightbox.css') + .pipe(csso()) + .pipe(gulp.dest('./dist')); +}); + +gulp.task('build', ['buildjs','csso']); + +gulp.task('default', ['pack']); -- cgit v1.2.3