12/22/2023 0 Comments Sass minify![]() Define tasks after requiring dependencies Good, looks like everything is working fine! This means we can add our sass compilation task, we already included the gulp-sass dependency for this earlier. Having required our dependencies we can run the command below to see if gulp4 is installed correctly. The gulp-cli uses this file to use the dependencies installed locally (rather than globally - gulp4 for example). At the top of the file we include our dependencies, in this case gulp and gulp-sass. This file should be at the root of your project. Now that we’ve got everything installed, the next thing we have to do is create our gulpfile.js. Note - if you want to use scss, gulp-sass compiles scss files as well! $ npm install -save-dev gulp-sass We’ve already installed the gulp 4 dependency in our project folder but for sass compilation we should add gulp-sass as well. Try putting gulpjs/gulp#4.0 inside quotation marks like so $ npm install -save-dev "gulpjs/gulp#4.0" Step 1: Sass/Scss compilation Note - if you’re using zsh you will get an error saying there are no matches found for this gulp version. This way you can call the gulp command anywhere (thanks to gulp-cli) but gulp-cli will always check the project folder for the installed gulp version. We should install gulp-cli globally and gulp itself as a development dependency. To set up gulp 4 we should install the latest gulp-cli and the gulp4 beta, we can install these using npm (or yarn) by installing directly from the repo (gulpjs/). ![]() If you’re interested to read more about gulp, check out the documentation for gulp 4.0 here. What is gulp? gulp describes itself as a toolkit which helps automating tasks in your development workflow. Even though Gulp is easy, it still took me a bit longer than expected to figure out its usage, especially so for gulp 4.0 (which still happens to be in beta) The Basics About a month ago I stumbled upon gulpjs, a task runner which makes automation easy and understandable.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |