summaryrefslogtreecommitdiff
path: root/gulpfile.js
diff options
context:
space:
mode:
authorVictor Häggqvist <[email protected]>2016-01-16 22:24:46 +0100
committerVictor Häggqvist <[email protected]>2016-01-16 22:24:46 +0100
commitbf18346798f871ac87665aa0353fcd22ac0479b5 (patch)
treedf8e985aea7119e4be860dc851142ee6e10865e9 /gulpfile.js
parent17f9e3dd9cb384e881773a1ba1dc0fb791d04b03 (diff)
update package files
Diffstat (limited to 'gulpfile.js')
-rw-r--r--gulpfile.js34
1 files changed, 32 insertions, 2 deletions
diff --git a/gulpfile.js b/gulpfile.js
index 8fb1871..aecfb9e 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -9,6 +9,8 @@ var size = require('gulp-size');
var uglify = require('gulp-uglify');
var webpack = require('webpack-stream');
var concat = require('gulp-concat');
+var header = require('gulp-header');
+var rename = require("gulp-rename");
gulp.task('style', function () {
return gulp.src('./style/touch-imagelightbox.scss')
@@ -65,25 +67,53 @@ gulp.task('lint', function() {
.pipe(eslint.failAfterError());
});
-
gulp.task('uglify', ['pack'], function() {
return gulp.src('./demo/LightBox.*.js')
.pipe(uglify())
+ .pipe(rename({suffix: ".min"}))
.pipe(gulp.dest('dist'));
});
+var bannerPlugins = ['/**',
+ ' * Image LightBox Plugins - <%= pkg.description %>',
+ ' * @version v<%= pkg.version %>',
+ ' * @link <%= pkg.homepage %>',
+ ' * @license <%= pkg.license %>',
+ ' * @author <%= pkg.authors%>',
+ ' */',
+ ''].join('\n');
+
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(rename({suffix: ".min"}))
+ .pipe(header(bannerPlugins, { pkg : pkg }))
+ .pipe(gulp.dest('./dist'));
+});
+
+var banner = ['/**',
+ ' * Image LightBox - <%= pkg.description %>',
+ ' * @version v<%= pkg.version %>',
+ ' * @link <%= pkg.homepage %>',
+ ' * @license <%= pkg.license %>',
+ ' * @author <%= pkg.authors%>',
+ ' */',
+ ''].join('\n');
+
+var pkg = require('./bower.json');
+gulp.task('makecore', ['buildjs'], function() {
+ gulp.src(['./dist/LightBox.Core.min.js'])
+ .pipe(header(banner, { pkg : pkg }))
.pipe(gulp.dest('./dist'));
});
gulp.task('csso', ['style'], function() {
return gulp.src('./demo/touch-imagelightbox.css')
.pipe(csso())
+ .pipe(rename({suffix: ".min"}))
.pipe(gulp.dest('./dist'));
});
-gulp.task('build', ['buildjs','csso']);
+gulp.task('build', ['makecore','csso']);
gulp.task('default', ['pack']);