Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Gulp 4.0.0 + SASS, minification, TailwindCSS, PHP and BrowserSync support
"use strict";
// Gulp 4.0.0 + SASS, minification, TailwindCSS, PHP and BrowserSync support
// (assumes you have your .scss + .css files in a /css directory)
var gulp = require('gulp'),
sass = require('gulp-sass'),
cssnano = require('gulp-cssnano'),
php = require('gulp-connect-php'),
browserSync = require('browser-sync');
var postcss = require('gulp-postcss');
var tailwindcss = require('tailwindcss');
var reload = browserSync.reload;
gulp.task('test', function() {
console.log('Hello World!');
gulp.task('css', function(){
return gulp.src('css/*.scss')
// Use gulp-sass to convert SCSS to CSS
// minimise
// write file to disk
// refresh browser
stream: true
// Troubleshooting - you should see CLI debug messages for both the
// PHP Development server (port 8000) and BrowserSync (ports 3000 + 3001)
// if PHP's base directory is specified wrong, the whole thing can just hang
gulp.task('default', function() {
// a standalone PHP server that browsersync connects to via proxy
port: 8000,
keepalive: true
}, function (){
proxy: ''
});'**/*.html').on('change', function () {
});'**/*.php').on('change', function () {
// the CSS task does it's own reloading"css/*.scss", gulp.series('css'));

This comment has been minimized.

Copy link

@sohrabzia sohrabzia commented Sep 28, 2020

could you explain line 27? why do we need to link js for CSS?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.