From 2eaee3cccfd802363d35bc8f4314c4df2313754a Mon Sep 17 00:00:00 2001 From: Victor Häggqvist Date: Wed, 13 Jan 2016 17:06:34 +0100 Subject: miao --- gulpfile.js | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 gulpfile.js (limited to 'gulpfile.js') diff --git a/gulpfile.js b/gulpfile.js new file mode 100644 index 0000000..0d2d7c5 --- /dev/null +++ b/gulpfile.js @@ -0,0 +1,48 @@ +/* eslint-env node */ +var gulp = require('gulp'); +var eslint = require('gulp-eslint'); +var sass = require('gulp-sass'); +var rename = require('gulp-rename'); +var autoprefixer = require('gulp-autoprefixer'); +var csso = require('gulp-csso'); +var size = require('gulp-size'); +var uglify = require('gulp-uglify'); +var webpack = require('webpack-stream'); + +var webpackOptions = { + output: { + filename: 'touch-imagelightbox.js', + library: 'LightBox', + libraryTarget: "var" + }, + module: { + loaders: [ + { + loader: 'babel', + query: { + presets: ['es2015'] + } + } + ] + } +}; + +gulp.task('pack', function() { + return gulp.src('./src/LightBox.js') + .pipe(webpack(webpackOptions)) + //.pipe(gulp.dest('./dist')); + .pipe(gulp.dest('./demo')); +}); + +gulp.task('default', ['pack']); + +gulp.task('watch', function () { + //gulp.watch('./src/LightBox.js', ['pack']) + + webpackOptions.watch = true; + + return gulp.src('./src/LightBox.js') + .pipe(webpack(webpackOptions)) + //.pipe(gulp.dest('./dist')); + .pipe(gulp.dest('./demo')); +}); -- cgit v1.2.3