AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Sass minify3/19/2023 ![]() Since we are done writing everything, make sure that you save your code and add this script in your package. ![]() If it detects any changes, it executions the tasks in order, first sass, then minify. It watches for any modifications in our scss files inside the sass folder. Load Url Browse Compile scss Beautify css Minify css Editor Options Download Clear. Now that we have that out of the way, let me explain what’s going on inside this task. Enter full url in import statements if your scss code has those. These tasks will be composed into a bigger operation that will be done, one after the other. ries is a function that receives any number of strings of previously registered tasks A series of tasks that must be executed when the change occurs.A string with the location of the files that must be watched.Gulp.watch is a function that receives two arguments. Here we added some new functions to the mix, watch, and series. Here is the code! gulp.task('sass', function sassFunc()) const gulp = require(‘gulp’) const concatCss = require(‘gulp-concat-css’) const cssNano = require(‘gulp-cssnano’) const sass = require(‘gulp-sass’) Īnd now let’s create our first task that will transform all our sass files into one single CSS file. Then, import gulp and the plugins that we installed previously so that we may use them. Next, you’ll need to create a Gulpfile.js file at the root of your project. Gulp-concat-css: plugin to concatenate multiple CSS files into one.Gulp-sass: plugin to transform your sass files to CSS.Gulp-cssnano: plugin to minify your CSS.npm i gulp gulp-cssnano gulp-sass gulp-concat-css -D So please make sure you run the following command in your terminal. I’m pretty sure all you want to know is how to use gulp.įirst things first, we will need a couple of things to start using gulp in our project. I won’t go into explaining what gulp is since you are already here. It can also compile all Sass files in a directory to CSS files with the same names in. Hello there! This is my second post so far and I’m really excited… so, let’s get started. The Dart Sass executable can be invoked in one of two modes.
0 Comments
Read More
Leave a Reply. |