Last active
January 15, 2025 13:14
-
-
Save BaronVonPerko/27cd6d5b8c25f4ceb3b04313f56ca75e to your computer and use it in GitHub Desktop.
Gulpfile for SCSS and Tailwind
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
var gulp = require('gulp'); | |
var sass = require('gulp-sass'); | |
var postcss = require('gulp-postcss'); | |
gulp.task('style', function () { | |
var tailwindcss = require('tailwindcss'); | |
return gulp.src('sass/**/*.scss') | |
.pipe(sass().on('error', sass.logError)) | |
.pipe(postcss([ | |
tailwindcss('./tailwind.js'), | |
require('autoprefixer'), | |
])) | |
.pipe(gulp.dest('./')); | |
}); | |
//Watch task | |
gulp.task('default',function() { | |
gulp.watch('sass/**/*.scss',['style']); | |
}); |
Also, the package.json
that worked for me is something similiar to the following:
"name": "Gulp-sassy-tail",
"scripts": {
"sassy": "gulp",
// ...
},
"dependencies": {
"autoprefixer": "10.4.15",
"gulp-cli": "^2.3.0",
"gulp-postcss": "^9.0.1",
"postcss": "8.4.28",
"tailwindcss": "3.3.3"
},
"devDependencies": {
"gulp": "^4.0.2",
"gulp-sass": "^5.1.0",
"sass": "^1.66.1"
},
"overrides": {
"glob-parent": "6.0.2"
}
}```
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just to sum it all up, the resulting
gulpfile.js
is the following: