forked from stevenwanderski/bxslider-4
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Eric Wafford
committed
Feb 3, 2015
1 parent
d5581ff
commit 4cafbf8
Showing
14 changed files
with
3,466 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
.jscsrc | ||
.DS_Store | ||
/node_modules | ||
jquery.bxslider.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,82 @@ | ||
var gulp = require( 'gulp' ) | ||
, uglify = require( 'gulp-uglify' ) | ||
, umd = require( 'gulp-wrap-umd' ) | ||
, rename = require( 'gulp-rename' ) | ||
, less = require( 'gulp-less' ) | ||
, path = require( 'path' ) | ||
, lessCleanCSS = require( 'less-plugin-clean-css' ) | ||
, jshint = require( 'gulp-jshint' ) | ||
, livereload = require( 'gulp-livereload' ) | ||
, gutil = require('gulp-util'); | ||
|
||
var cleancss = new lessCleanCSS( {advanced: true} ); | ||
|
||
gulp.task( 'copyAssets', function() { | ||
|
||
gulp.src( 'src/images/*' ) | ||
.pipe( gulp.dest( 'dist/images' ) ) | ||
}) | ||
|
||
gulp.task( 'buildJS', function() { | ||
|
||
gulp.src( 'src/jquery.bxslider.js') | ||
.pipe( jshint() ) | ||
.pipe( jshint.reporter('jshint-stylish') ) | ||
.pipe( uglify().on('error', gutil.log) ) | ||
.pipe( rename( 'jquery.bxslider.min.js' ) ) | ||
.pipe( gulp.dest( 'dist' ) ); | ||
// ## Globals | ||
/*global $:true*/ | ||
var $ = require('gulp-load-plugins')(); | ||
var gulp = require('gulp'); | ||
|
||
// ### Styles | ||
// `gulp styles` - compiles and optimizes css. | ||
gulp.task('styles', function() { | ||
return gulp.src('./src/less/*.less') | ||
.pipe($.less()) | ||
.pipe($.pleeease({ | ||
autoprefixer: { | ||
browsers: [ | ||
'last 2 versions', 'ie 8', 'ie 9', 'android 2.3', 'android 4', | ||
'opera 12' | ||
] | ||
}, | ||
minifier: false | ||
})) | ||
.pipe(gulp.dest('./dist/')); | ||
}); | ||
|
||
// ### Scripts | ||
// `gulp scripts` - runs jshint and uglify | ||
gulp.task('scripts', ['jshint'], function() { | ||
return gulp.src('./src/js/*.js') | ||
.pipe(gulp.dest('./dist/')) | ||
.pipe($.uglify({ | ||
preserveComments: function (node, comment) { | ||
if (/^\*\*/.test(comment.value) && /\*\*$/.test(comment.value)) { | ||
|
||
console.log('Found tri-star comment. Preserving.'); | ||
return true; | ||
} | ||
} | ||
})) | ||
.pipe($.rename({extname: '.min.js'})) | ||
.pipe(gulp.dest('./dist/')); | ||
}); | ||
|
||
gulp.task( 'buildCSS', function () { | ||
// ### Vendor Scripts | ||
// `gulp vendor` - runs uglify on 3rd party plugins | ||
gulp.task('vendor', function() { | ||
return gulp.src('./src/vendor/*.js') | ||
.pipe(gulp.dest('./dist/vendor')); | ||
}); | ||
|
||
// ### Images | ||
// `gulp images` - run lossless compression on all the images. | ||
gulp.task('images', function() { | ||
return gulp.src('./src/images/*') | ||
.pipe($.imagemin({ | ||
progressive: true, | ||
interlaced: true | ||
})) | ||
.pipe(gulp.dest('./dist/images')); | ||
}); | ||
|
||
gulp.src( 'src/less/*.less') | ||
.pipe( less() ) | ||
.pipe( gulp.dest('dist') ); | ||
// ### JsHint | ||
// `gulp jshint` - lints configuration JSON and project javascript | ||
gulp.task('jshint', function() { | ||
return gulp.src([ 'bower.json', 'gulpfile.js', './src/*.js' ]) | ||
.pipe($.jshint()) | ||
.pipe($.jshint.reporter('jshint-stylish')) | ||
.pipe($.jshint.reporter('fail')); | ||
}); | ||
|
||
gulp.task( 'default', function() { | ||
// ### Clean | ||
// `gulp clean` - deletes the build folder entirely | ||
gulp.task('clean', require('del').bind(null, ['dist/'])); | ||
|
||
// ### Build | ||
// `gulp build` - Run all the build tasks but don't clean up beforehand. | ||
// Generally you should be running `gulp` instead of `gulp build`. | ||
gulp.task('build', ['styles', 'scripts', 'images', 'vendor']); | ||
|
||
livereload.listen() | ||
gulp.watch( [ 'docs/*.html', 'docs/examples/*.html', 'src/*.js' ] ).on( 'change', livereload.changed ) | ||
}) | ||
|
||
gulp.task( 'build', [ 'buildJS', 'buildCSS', 'copyAssets' ] ) | ||
// ### Gulp | ||
// `gulp` - Run a complete build. To compile for production run `gulp --production`. | ||
gulp.task('default', ['clean'], function() { | ||
gulp.start('build'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.