-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improvement(*): remove console.log from distribution [closes #235]
- Loading branch information
Showing
2 changed files
with
54 additions
and
43 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,45 +1,55 @@ | ||
var gulp = require('gulp'); | ||
var uglify = require('gulp-uglify'); | ||
var umd = require('gulp-wrap-umd'); | ||
var rename = require('gulp-rename'); | ||
var bower = require('bower-json'); | ||
var browser = require('browser-sync').create(); | ||
|
||
|
||
gulp.task( 'dist', function() { | ||
gulp.src('scrollreveal.js') | ||
.pipe( umd({ namespace: 'ScrollReveal', exports: 'this.ScrollReveal' }) ) | ||
.pipe( gulp.dest('dist') ) | ||
}); | ||
var bower = require('bower-json'); | ||
var browser = require('browser-sync').create(); | ||
var gulp = require('gulp'); | ||
var rename = require('gulp-rename'); | ||
var stripDebug = require('gulp-strip-debug'); | ||
var uglify = require('gulp-uglify'); | ||
var umd = require('gulp-wrap-umd'); | ||
|
||
/** | ||
* Development Tasks | ||
*/ | ||
|
||
gulp.task( 'dev', function() { | ||
gulp.src('scrollreveal.js') | ||
.pipe( gulp.dest('dev') ); | ||
gulp.task('dev', function(){ | ||
gulp.src('dist/scrollreveal.min.js') | ||
.pipe(gulp.dest('dev')); | ||
}); | ||
|
||
gulp.task( 'validate', function() { | ||
bower.read('./bower.json', function( err, json ) { | ||
if ( err ) { | ||
console.error('There was an error reading the file'); | ||
console.error( err.message ); | ||
return; | ||
} | ||
}); | ||
gulp.task('default', function(){ | ||
browser.init({ server: { baseDir: './dev' }}); | ||
gulp.start(['dev']); | ||
gulp.watch(['scrollreveal.js'], ['dev']) | ||
gulp.watch(['dev/*.*']).on('change', browser.reload); | ||
}); | ||
|
||
gulp.task( 'dist:minify', function() { | ||
gulp.src('scrollreveal.js') | ||
.pipe( umd({ namespace: 'ScrollReveal', exports: 'this.ScrollReveal' }) ) | ||
.pipe( uglify() ) | ||
.pipe( rename('scrollreveal.min.js') ) | ||
.pipe( gulp.dest('dist') ) | ||
}) | ||
/** | ||
* Deployment Tasks | ||
*/ | ||
|
||
gulp.task( 'default', function() { | ||
browser.init({ server: { baseDir: "./dev" } }); | ||
gulp.start(['dev']); | ||
gulp.watch([ 'scrollreveal.js '], [ 'dev' ]) | ||
gulp.watch([ 'dev/*.*' ]).on( "change", browser.reload ); | ||
gulp.task('validate', function(){ | ||
bower.read('./bower.json', function(err, json){ | ||
if (err) { | ||
console.error('There was an error reading the file:'); | ||
console.error( err.message ); | ||
return | ||
} | ||
}); | ||
}); | ||
|
||
gulp.task( 'build', [ 'validate','dist', 'dist:minify' ]); | ||
gulp.task('dist', function(){ | ||
gulp.src('scrollreveal.js') | ||
.pipe(umd({ namespace: 'ScrollReveal', exports: 'this.ScrollReveal' })) | ||
.pipe(stripDebug()) | ||
.pipe(gulp.dest('dist')) | ||
}); | ||
|
||
gulp.task('dist:minify', function(){ | ||
gulp.src('scrollreveal.js') | ||
.pipe(umd({ namespace: 'ScrollReveal', exports: 'this.ScrollReveal' })) | ||
.pipe(stripDebug()) | ||
.pipe(uglify()) | ||
.pipe(rename('scrollreveal.min.js')) | ||
.pipe(gulp.dest('dist')) | ||
}) | ||
|
||
gulp.task('build', ['validate', 'dist', 'dist:minify']); |
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