Skip to content

Commit

Permalink
built out gulpfile
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-weber-ae committed Apr 26, 2019
1 parent 93b6786 commit ffc81d8
Show file tree
Hide file tree
Showing 7 changed files with 126 additions and 18 deletions.
53 changes: 36 additions & 17 deletions gulpfile.js
Expand Up @@ -8,12 +8,15 @@ PLUGINS

var gulp = require('gulp'),
plumber = require('gulp-plumber'),
gulpSize = require('gulp-size');
gulpSize = require('gulp-size'),
del = require('del');

var sass = require('gulp-sass'),
autoprefixer = require('gulp-autoprefixer'),
cssmin = require('gulp-cssmin');

sass.compiler = require('node-sass');

var concat = require('gulp-concat'),
uglify = require('gulp-uglify');

Expand All @@ -24,28 +27,44 @@ TASKS
=====
*/

function sass() {
return gulp.src('/lib/*.scss')
.pipe(plumber({
errorHandler: function(err) {
console.log('sass task error: ', err);
this.emit('end');
}
}))
.pipe(sass())
.pipe(autoprefixer({
browsers: ['last 6 versions'],
cascade: false
}))
.pipe(cssmin())
.pipe(gulp.dest('lib/build'));
function clean() {
return del(['./lib/build']);
}

function compileSass() {
return gulp.src('./lib/*.scss')
.pipe(plumber())
.pipe(sass())
.pipe(autoprefixer({
browsers: ['last 6 versions'],
cascade: false
}))
.pipe(cssmin())
.pipe(gulp.dest('./lib/build'));
}

function compileJs() {
return gulp.src('./lib/*.js')
.pipe(plumber())
.pipe(concat('scrollcarousel.min.js'))
.pipe(uglify())
.pipe(gulp.dest('./lib/build'));
}

function watch() {
gulp.watch('./lib/*.js', compileJs);
gulp.watch('./lib/*.scss', compileSass);
}

/*
=====
EXPORT TASKS
=====
*/

exports.sass = sass;
exports.clean = clean;
exports.css = compileSass;
exports.js = compileJs;
exports.watch = watch;

exports.default = gulp.series(clean, gulp.parallel(compileSass, compileJs));
Empty file removed index.js
Empty file.
1 change: 1 addition & 0 deletions lib/build/carousel.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/build/scrollcarousel.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/scrollcarousel.js
Expand Up @@ -317,4 +317,4 @@
return _;

}
})(jQuery);
})(jQuery);
86 changes: 86 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Expand Up @@ -22,6 +22,7 @@
},
"homepage": "https://github.com/webermn15/scrollcarousel#readme",
"devDependencies": {
"del": "^4.1.0",
"gulp": "^4.0.1",
"gulp-autoprefixer": "^6.1.0",
"gulp-concat": "^2.6.1",
Expand Down

0 comments on commit ffc81d8

Please sign in to comment.