Skip to content

Commit

Permalink
adding basic gulp file
Browse files Browse the repository at this point in the history
  • Loading branch information
djp424 committed Apr 16, 2016
1 parent e0e8a27 commit b66e9e0
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions gulp.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
var autoprefixer = require('gulp-autoprefixer');
var browserSync = require('browser-sync').create(); // http://www.browsersync.io/docs/gulp/
var concat = require('gulp-concat'); // https://www.npmjs.com/package/gulp-concat/
var gulp = require('gulp');
var minifyCss = require('gulp-minify-css');
var sass = require('gulp-sass');

gulp.task('js', function() {
return gulp.src(['./js/skip-link-focus-fix.js'])
.pipe(concat('scripts.js'))
.pipe(gulp.dest('./dist/'));
});

// sass -> css -> combine
gulp.task('sass', function () {
gulp.src('./sass/**/*.scss')
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest('./css'))
.pipe(autoprefixer({
browsers: [
'last 2 versions',
'ie 8',
'ie 9',
'android 2.3',
'android 4',
'opera 12'
]
}))
.pipe(gulp.dest('dist'))
// .pipe(minifyCss())
// .pipe(gulp.dest('dist'))
.pipe(browserSync.stream());
});

// ### Watch
gulp.task('watch', function() {
browserSync.init({
files: ['{lib,templates}/**/*.php', '*.php'],
// proxy: config.devUrl,
proxy: 'localhost:7888',
snippetOptions: {
whitelist: ['/wp-admin/admin-ajax.php'],
blacklist: ['/wp-admin/**']
}
});
// gulp.watch([path.source + 'styles/**/*'], ['styles']);
// gulp.watch([path.source + 'scripts/**/*'], ['jshint', 'scripts']);
// gulp.watch([path.source + 'fonts/**/*'], ['fonts']);
// gulp.watch([path.source + 'images/**/*'], ['images']);
// gulp.watch(['bower.json', 'assets/manifest.json'], ['build']);

gulp.watch('js/**/*', ['js']);
gulp.watch('sass/**/*', ['sass']);
gulp.watch('*.php').on('change', browserSync.reload);
});

// ### Watch
gulp.task('default', function() {
// deafult tasks
});

0 comments on commit b66e9e0

Please sign in to comment.