Break out Tailwind config and CSS file locations into variables

This commit is contained in:
Taylor Bryant 2017-11-14 22:03:47 -06:00
parent 1fafec34a6
commit 55af4a7950
1 changed files with 5 additions and 4 deletions

View File

@ -3,7 +3,8 @@ const gutil = require('gulp-util');
const child = require('child_process');
const browserSync = require('browser-sync').create();
const siteRoot = '_site';
const cssFiles = 'src/*';
const cssFiles = 'src/style.css';
const tailwindConfig = 'tailwind-config.js';
gulp.task('jekyll', () => {
const jekyll = child.spawn('jekyll', ['serve',
@ -29,10 +30,10 @@ gulp.task('css', function () {
const autoprefixer = require('gulp-autoprefixer');
const cleancss = require('gulp-clean-css');
return gulp.src('src/style.css')
return gulp.src(cssFiles)
.pipe(postcss([
atimport(),
tailwindcss('src/tailwind-config.js')
tailwindcss(tailwindConfig)
]))
.pipe(autoprefixer({
browsers: ['last 2 versions'],
@ -52,7 +53,7 @@ gulp.task('serve', () => {
}
});
gulp.watch(cssFiles, ['css']);
gulp.watch([cssFiles, tailwindConfig], ['css']);
});
gulp.task('default', ['css', 'jekyll', 'serve']);