1/9/2024 0 Comments Gulp minify cssI couldn't seem to find such a basic tutorial on the web that was explained in simple terms. This encompasses many things, but let's focus on a basic use case for minifying JavaScript and CSS files. Gulp.watch('./js/**/*.js').on('change', browserSync. gulp is a toolkit for automating painful or time-consuming tasks in your development workflow. Here’s how the gulpfile.js and package.json files looks like - onst gulp = require('gulp') I’ve tried using the next snippet on the package page and there’s no debug messages in the console? I’ve checked the CSS file it isn’t compressed. Hi Martyr2! Not sure why I called you Jason lol The instructions on the package page still uses task? Should I use this with gulp v4? This is how my gulpfile.js looks like - const gulp = require('gulp') Ĭonst cleanCSS = require('gulp-clean-css') I have tried adding it to my gulpfile.js but the CSS isn’t minifying? I have installed gulp-clean-css as you recommended. We can do all this easily by using Bundler & Minifier Convert To Gulp option. Gulp.watch('./*.php').on('change', browserSync.reload) The first step to start using Gulp in your ASP.NET Core project is to install Gulp and related npm modules and create a Gulpfile.js. Gulp.watch('./*.html').on('change', browserSync.reload) This is what my gruntfile.js looks like - const gulp = require('gulp')Ĭonst browserSync = require('browser-sync').create() Most of the structure of my gulpfile.is is from the youtube tutorial that I’ve shared and also to get wordpress working locally with grunt I used the proxy snippet in the tutorial on the other link. There seems to be old gulp tutorials using the task method and the new gulp v4 uses different techniques. What I can’t figure out is what CSS minify npm to install and how to apply it to my gulpfile.js? I am building a wordpress website locally and have managed to get gulp to work without refreshing the browser so when I save CSS, JS or PHP the browser automatically refreshes which is amazing! Hi can anyone help me add CSS minify to my gulp project? I’d also like to add JS minify & concatenate.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |