Last active
August 5, 2020 18:41
-
-
Save muiton/70f6b0e1d6f4671d56ddacb628a1ed40 to your computer and use it in GitHub Desktop.
Gulp file for Tailwind CSS Sass compiling with hot reloading/building. Please rename file to gulpfile.js
This file contains hidden or 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
// First rename File to gulpfile.js | |
const { src, dest, task, | |
watch, series } = require('gulp'); | |
const sass = require('gulp-sass'); | |
const postcss = require('gulp-postcss'); | |
const tailwindcss = require('tailwindcss'); | |
const autoprefixer = require('autoprefixer'); | |
task('dev-style', () => { | |
return src('sass/**/*.scss') | |
.pipe(sass().on('error', sass.logError)) | |
.pipe(postcss([ | |
tailwindcss('./tailwind.config.js'), | |
autoprefixer() | |
])) | |
.pipe(dest('./')); | |
}); | |
task('watch', (done) => { | |
watch('sass/**/*.scss', series('dev-style')); | |
done(); | |
}) | |
exports.default = series('dev-style', 'watch'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment