summaryrefslogtreecommitdiff
path: root/gulpfile.js
diff options
context:
space:
mode:
authorVictor Häggqvist <[email protected]>2016-01-16 22:00:36 +0100
committerVictor Häggqvist <[email protected]>2016-01-16 22:00:36 +0100
commit60d6c5f3e46b887806e252d5dea1f04715a81e0d (patch)
treeec87e4bd38fd6e59a26e24bfd57145a4f77e5147 /gulpfile.js
parent47b575b89249f34a364b516161cbe1e33df0f3a4 (diff)
write some docs and fixup demo
Diffstat (limited to 'gulpfile.js')
-rw-r--r--gulpfile.js33
1 files changed, 31 insertions, 2 deletions
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']);