Skip to content
This repository has been archived by the owner on Oct 11, 2019. It is now read-only.

Commit

Permalink
by iamdroid: Updated build script and dependencies.
Browse files Browse the repository at this point in the history
  • Loading branch information
i-amdroid committed Jul 7, 2018
1 parent be266c5 commit 11a32af
Show file tree
Hide file tree
Showing 10 changed files with 31,468 additions and 98 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ examples/*
node_modules/*
.sass-cache/*
.DS_Store
package-lock.json
61 changes: 35 additions & 26 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
var gulp = require('gulp');
var watch = require('gulp-watch');
var batch = require('gulp-batch');
var sass = require('gulp-sass');
var sasslint = require('gulp-sass-lint');
var eslint = require('gulp-eslint');
var changed = require('gulp-changed');
var autoprefixer = require('gulp-autoprefixer');
var imagemin = require('gulp-imagemin');

Expand All @@ -11,6 +12,23 @@ var CSS = 'css';
var IMG = 'img';
var JS = 'js';

var sassOptions = {
includePaths: ['./node_modules/breakpoint-sass/stylesheets']
};

var autoprefixerOptions = {
browsers: ['> 1%']
};

// tasks

gulp.task('sass', function () {
return gulp.src(SASS + '/**/*.scss')
.pipe(sass.sync(sassOptions).on('error', sass.logError))
.pipe(autoprefixer(autoprefixerOptions))
.pipe(gulp.dest(CSS));
});

gulp.task('sass-lint', function () {
return gulp.src(SASS + '/**/*.scss')
.pipe(sasslint())
Expand All @@ -25,42 +43,33 @@ gulp.task('js-lint', function () {
.pipe(eslint.failAfterError());
});

gulp.task('sass', function () {
return gulp.src(SASS + '/**/*.scss')
.pipe(sass({
includePaths: ['./node_modules/breakpoint-sass/stylesheets']
}).on('error', sass.logError))
.pipe(gulp.dest(CSS));
});

gulp.task('autoprefixer', ['sass'], function() {
gulp.src(CSS + '/*.css')
//.pipe(changed(CSS))
.pipe(autoprefixer({
browsers: ['> 1%']
}))
.pipe(gulp.dest(CSS));
});

gulp.task('imagemin', function() {
gulp.src(IMG + '/src/*')
.pipe(imagemin())
.pipe(gulp.dest(IMG));
});

gulp.task('build', ['sass', 'autoprefixer', 'imagemin']);
// build without lint

gulp.task('build', ['sass', 'imagemin']);

gulp.task('watch', function() {
gulp.watch(SASS + '/**/*.scss', ['sass', 'autoprefixer', 'imagemin']);
gulp.task('watch', function () {
watch(SASS + '/**/*.scss', batch(function (events, done) {
gulp.start('build', done);
}));
});

gulp.task('build-lint', ['sass-lint', 'sass', 'autoprefixer', 'imagemin', 'js-lint']);
// build with lint

gulp.task('build-lint', ['sass-lint', 'sass', 'imagemin', 'js-lint']);

gulp.task('watch-lint', function() {
gulp.watch(SASS + '/**/*.scss', ['sass-lint', 'sass', 'autoprefixer', 'imagemin']);
gulp.watch(JS + '/**/*.js', ['js-lint']);
gulp.task('watch-lint', function () {
watch(SASS + '/**/*.scss', batch(function (events, done) {
gulp.start('build-int', done);
}));
});

gulp.task('default', ['build', 'watch']);
// default task

gulp.task('default', ['build', 'watch']);
//gulp.task('default', ['build-lint', 'watch-lint']);
Loading

0 comments on commit 11a32af

Please sign in to comment.