{"id":1132,"date":"2014-10-12T04:00:22","date_gmt":"2014-10-12T01:00:22","guid":{"rendered":"http:\/\/www.webcodegeeks.com\/?p=1132"},"modified":"2014-10-11T18:03:07","modified_gmt":"2014-10-11T15:03:07","slug":"how-to-use-gulp-to-generate-css-from-sassscss","status":"publish","type":"post","link":"https:\/\/www.webcodegeeks.com\/css\/how-to-use-gulp-to-generate-css-from-sassscss\/","title":{"rendered":"How to use Gulp to generate CSS from Sass\/scss"},"content":{"rendered":"<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<table border=\"1\">\n<tbody>\n<tr>\n<td>\n<h2 style=\"text-align: center;\">Contents<\/h2>\n<ul>\n<li><a href=\"#1_Set_up_the_infrastructure\">1. Set up the infrastructure<\/a>\n<ul>\n<li><a href=\"#11_Install_Nodejs\">1.1. Install Node.js<\/a><\/li>\n<li><a href=\"#12_Install_gulp\">1.2. Install gulp<\/a>\n<ul>\n<li><a href=\"#121_Install_gulp_globally\">1.2.1. Install gulp globally<\/a><\/li>\n<li><a href=\"#122_Install_gulp_in_your_project_devDependencies\">1.2.2. Install gulp in your project devDependencies:<\/a><\/li>\n<li><a href=\"#123_Create_a_gulpfilejs_at_the_root_of_the_project\">1.2.3. Create a gulpfile.js at the root of the project:<\/a><\/li>\n<li><a href=\"#124_Run_gulp\">1.2.4. Run gulp<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"#13_Install_Gulp_plugins\">1.3. Install Gulp plugins<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"#2_gulpfilejs\">2. gulpfile.js<\/a>\n<ul>\n<li><a href=\"#21_Load_the_modules\">2.1. Load the modules<\/a><\/li>\n<li><a href=\"#22_Gulp_tasks\">2.2. Gulp tasks<\/a><\/li>\n<li><a href=\"#23_Pipes\">2.3. Pipes<\/a><\/li>\n<li><a href=\"#24_8220Watching8221_files_for_modifications\">2.4. \u201cWatching\u201d files for modifications<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"#3_Resources\">3. Resources<\/a>\n<ul>\n<li><a href=\"#31_Source_code\">3.1. Source code<\/a><\/li>\n<li><a href=\"#32_Codingpediaorg_related\">3.2. Codingpedia.org related<\/a><\/li>\n<li><a href=\"#33_Web\">3.3. Web<\/a><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<blockquote><p><strong><em>Note:<\/em><\/strong><em>This is the sequel of the post <a title=\"http:\/\/www.codingpedia.org\/ama\/css-preprocessors-introducing-sass-to-podcastpedia-org\/\" href=\"http:\/\/www.codingpedia.org\/ama\/css-preprocessors-introducing-sass-to-podcastpedia-org\/\" target=\"_blank\">CSS Preprocessors \u2013 Introducing Sass to Podcastpedia.org<\/a>. If in the first part I presented some Sass-features I use to generated the CSS file for <a title=\"Podcastpedia.org, knowledge to go\" href=\"http:\/\/www.podcastpedia.org\" target=\"_blank\">Podcastpedia.org<\/a>, in this part I will present how the .css file generation process can be implemented with the help of Gulpjs.<\/em><\/p><\/blockquote>\n<h2>1. Set up the infrastructure<\/h2>\n<h3>1.1. Install Node.js<\/h3>\n<p>Well, the first I needed to do is install <a title=\"http:\/\/nodejs.org\/\" href=\"http:\/\/nodejs.org\/\" target=\"_blank\">Nodejs<\/a>:<\/p>\n<p><em>\u201cNode.js is a platform built on Chrome\u2019s JavaScript runtime for easily building fast, scalable network applications. Node.js uses an event-driven, non-blocking I\/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.\u201d<\/em>[1]<\/p>\n<h3>1.2. Install gulp<\/h3>\n<p>Gulp is a task runner which uses node.js. It doesn\u2019t do much \u2013 it provides some streams and a basic task system.<\/p>\n<h2><a href=\"https:\/\/github.com\/gulpjs\/gulp\/blob\/master\/docs\/getting-started.md#1-install-gulp-globally\" name=\"1-install-gulp-globally\"><\/a>1.2.1. Install gulp globally<\/h2>\n<p>Install gulp globally command<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nnpm install -g gulp <\/pre>\n<h2><a href=\"https:\/\/github.com\/gulpjs\/gulp\/blob\/master\/docs\/getting-started.md#2-install-gulp-in-your-project-devdependencies\" name=\"2-install-gulp-in-your-project-devdependencies\"><\/a>1.2.2. Install gulp in your project devDependencies:<\/h2>\n<p>Install gulp in the project command<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nnpm install --save-dev gulp<\/pre>\n<h2>1.2.3. Create a <code>gulpfile.js<\/code> at the root of the project:<\/h2>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\nvar gulp = require('gulp');\r\n\r\ngulp.task('default', function() {\r\n  \/\/ place code for your default task here\r\n}); <\/pre>\n<h2><span id=\"124_Run_gulp\">1.2.4. Run gulp<\/span><\/h2>\n<p>The default task from above will run and do nothing for the moment. You can execute it by typing the following command in the root folder of the project<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\ngulp <\/pre>\n<h3><span id=\"13_Install_Gulp_plugins\">1.3. Install Gulp plugins<\/span><\/h3>\n<p>One of the Gulp\u2019s strengths is the myriad of existing \u201cplugins\u201d, and because the Gulp community is growing, new ones are added daily. The ones that I use for the generation of the CSS file are<\/p>\n<ul>\n<li><a title=\"https:\/\/github.com\/gulpjs\/gulp-util\" href=\"https:\/\/github.com\/gulpjs\/gulp-util\" target=\"_blank\">gulp-util<\/a> \u2013 utility functions for gulp plugins<\/li>\n<li><a title=\"https:\/\/www.npmjs.org\/package\/gulp-sass\" href=\"https:\/\/www.npmjs.org\/package\/gulp-sass\" target=\"_blank\">gulp-sass<\/a> \u2013 gulp plugin for sass<\/li>\n<li><a title=\"https:\/\/www.npmjs.org\/package\/gulp-minify-css\" href=\"https:\/\/www.npmjs.org\/package\/gulp-minify-css\" target=\"_blank\">gulp-minify-css<\/a> \u2013 minify css with clean-css<\/li>\n<li><a title=\"https:\/\/www.npmjs.org\/package\/gulp-rename\" href=\"https:\/\/www.npmjs.org\/package\/gulp-rename\" target=\"_blank\">gulp-rename<\/a> \u2013 rename files<\/li>\n<li><a title=\"https:\/\/www.npmjs.org\/package\/gulp-autoprefixer\" href=\"https:\/\/www.npmjs.org\/package\/gulp-autoprefixer\" target=\"_blank\">gulp-autoprefixer<\/a> \u2013 autoprefixer for gulp<\/li>\n<\/ul>\n<p>To install these plugins issue the following command in the console in the root folder of the project:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nnpm install --save-dev gulp-util gulp-sass gulp-minify-css gulp-rename gulp-autoprefixer <\/pre>\n<p>The <code>--save-dev<\/code> option saves these packages to the <code>devDependencies<\/code> list in the <code>package.json:<\/code><\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n&quot;devDependencies&quot;: {\r\n    &quot;gulp&quot;: &quot;~3.6.1&quot;,\r\n    &quot;gulp-minify-css&quot;: &quot;~0.3.1&quot;,\r\n    &quot;gulp-util&quot;: &quot;~2.2.14&quot;,\r\n    &quot;gulp-rename&quot;: &quot;~1.2.0&quot;,\r\n    &quot;gulp-sass&quot;: &quot;~0.7.1&quot;,\r\n    &quot;gulp-autoprefixer&quot;: &quot;0.0.7&quot;\r\n}<\/pre>\n<blockquote>\n<p class=\"alert_note\"><strong><em>Note<\/em><\/strong>: There are all development dependencies as I only use this project to generate a CSS file. For libraries used in production you would add those under the \u201cdependencies\u201d element in your<em>package.json<\/em> file. The <em><a title=\"https:\/\/npmjs.org\/doc\/json.html\" href=\"https:\/\/npmjs.org\/doc\/json.html\" target=\"_blank\">package.json<\/a><\/em> file holds variaous metadata relevant to the project and is contained in all <a title=\"http:\/\/en.wikipedia.org\/wiki\/Npm_%28software%29\" href=\"http:\/\/en.wikipedia.org\/wiki\/Npm_%28software%29\" target=\"_blank\">npm<\/a> packages. You can create the <em>package.json<\/em> file according to the <a title=\"https:\/\/www.npmjs.org\/doc\/json.html\" href=\"https:\/\/www.npmjs.org\/doc\/json.html\" target=\"_blank\">docs<\/a> or by issueing <code>npm init<\/code> in the root of of your project. You can find <a title=\"https:\/\/github.com\/podcastpedia\/css-generator-sass-gulp\/blob\/f53600ed4abb314f7d13d5ba8ace014d83bc5f93\/package.json\" href=\"https:\/\/github.com\/podcastpedia\/css-generator-sass-gulp\/blob\/f53600ed4abb314f7d13d5ba8ace014d83bc5f93\/package.json\" target=\"_blank\">the complete package.json file for this project on GitHub<\/a>.<\/p>\n<\/blockquote>\n<p>Now that we have everything set up, let\u2019s do some actual work, and by that I mean some <strong>coding<\/strong> not configuration, as with Gulp the build file is code not config.<\/p>\n<h2><span id=\"2_gulpfilejs\">2. gulpfile.js<\/span><\/h2>\n<h3><span id=\"21_Load_the_modules\">2.1. Load the modules<\/span><\/h3>\n<p>Node has a simple module loading system. In Node, files and modules are in one-to-one correspondence. When I installed the plugins in the previous step, they have been downloaded locally in the root folder under <em>node_modules<\/em>. You can load them now in the application via the <code>require()<\/code> function. Variables are defined to be used later in the gulp tasks:<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\nvar gulp = require(&quot;gulp&quot;),\/\/http:\/\/gulpjs.com\/\r\n    util = require(&quot;gulp-util&quot;),\/\/https:\/\/github.com\/gulpjs\/gulp-util\r\n    sass = require(&quot;gulp-sass&quot;),\/\/https:\/\/www.npmjs.org\/package\/gulp-sass\r\n    autoprefixer = require('gulp-autoprefixer'),\/\/https:\/\/www.npmjs.org\/package\/gulp-autoprefixer\r\n    minifycss = require('gulp-minify-css'),\/\/https:\/\/www.npmjs.org\/package\/gulp-minify-css\r\n    rename = require('gulp-rename'),\/\/https:\/\/www.npmjs.org\/package\/gulp-rename\r\n    log = util.log;<\/pre>\n<h3><span id=\"22_Gulp_tasks\">2.2. Gulp tasks<\/span><\/h3>\n<p>Gulp works with tasks. You define them by<\/p>\n<ul>\n<li>registering a name (e.g. <code>\"sass\"<\/code>, <code>\"watch\"<\/code>)<\/li>\n<li>an array of tasks to be executed and completed before your task will run<\/li>\n<li>and a function that performs the task\u2019s operations:<\/li>\n<\/ul>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\ngulp.task('mytask', &#x5B;'array', 'of', 'task', 'names'], function() {\r\n  \/\/ Do stuff\r\n});<\/pre>\n<h3><span id=\"23_Pipes\">2.3. Pipes<\/span><\/h3>\n<p>Gulp\u2019s power lies in its code over configuration approach and the use of <a title=\"http:\/\/nodejs.org\/api\/stream.html\" href=\"http:\/\/nodejs.org\/api\/stream.html\" target=\"_blank\">streams<\/a>. Streams use <code>.pipe()<\/code> to pair inputs with outputs.<\/p>\n<p><code>\".pipe()<\/code> is just a function that takes a readable source stream <code>src<\/code> and hooks the output to a destination writable stream <code>dst<\/code>:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nsrc.pipe(dst)<\/pre>\n<p><code>.pipe(dst)<\/code> returns <code>dst<\/code> so that you can chain together multiple <code>.pipe()<\/code> calls together:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\na.pipe(b).pipe(c).pipe(d)<\/pre>\n<p>which is the same as:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\na.pipe(b);\r\nb.pipe(c);\r\nc.pipe(d);<\/pre>\n<p>This is very much like what you might do on the command-line to pipe programs together:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\na | b | c | d<\/pre>\n<p>except in node instead of the shell! \u201d [7]<\/p>\n<p>Using the principle mentioned above I defined a \u201csass\u201d task, which will eventually generate the CSS file. To achieve that I \u201cpiped\u201d the following operations<\/p>\n<ul>\n<li>load the .scss files<\/li>\n<li>autoprefix them,<\/li>\n<li>write them expanded to file<\/li>\n<li>minify them<\/li>\n<li>and write them (<em>podcastpedia.css<\/em>, <em>podcastpedia.min.css<\/em>) minified to disk in the folder <em>target\/css<\/em>:<\/li>\n<\/ul>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\ngulp.task(&quot;sass&quot;, function(){\r\n    log(&quot;Generate CSS files &quot; + (new Date()).toString());\r\n    gulp.src(sassFiles)\r\n        .pipe(sass({ style: 'expanded' }))\r\n                    .pipe(autoprefixer(&quot;last 3 version&quot;,&quot;safari 5&quot;, &quot;ie 8&quot;, &quot;ie 9&quot;))\r\n        .pipe(gulp.dest(&quot;target\/css&quot;))\r\n        .pipe(rename({suffix: '.min'}))\r\n        .pipe(minifycss())\r\n        .pipe(gulp.dest('target\/css'));\r\n});<\/pre>\n<p>To run the task I have to execute <code>gulp sass<\/code> on the command line in the root folder.<\/p>\n<blockquote>\n<p class=\"alert_note\"><em><strong>Note:<\/strong><\/em> With the help of gulp-autoprefixer plugin, you can avoid having to write tedious mixins for vendor prefixes. As it is set up here \u2013 <code>autoprefixer(\"last 3 version\",\"safari 5\", \"ie 8\", \"ie 9\")<\/code>, this plugin will do the vendor prefixes covering the last 3 versions of major browsers plus dedicated configuration for safari5, and internet explorer 8 and 9.<\/p>\n<\/blockquote>\n<h3><span id=\"24_8220Watching8221_files_for_modifications\">2.4. \u201cWatching\u201d files for modifications<\/span><\/h3>\n<p>Gulp has a built-in \u201cwatch\u201d functionality \u2013 you can watch files and every time when a file changes you can do something. In the following example:<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\ngulp.task(&quot;watch&quot;, function(){\r\n    log(&quot;Watching scss files for modifications&quot;);\r\n    gulp.watch(sassFiles, &#x5B;&quot;sass&quot;]);\r\n});<\/pre>\n<p>every time I modify a <em>.scss<\/em> file the \u201csass\u201d task will be executed.<\/p>\n<p>Well, that\u2019s it \u2013 few lines of code for pretty good functionality. I am looking forward to dwelve more and find out what Gulp can do\u2026 Your comments, suggestions and code contributions are very welcomed.<\/p>\n<h2><span id=\"3_Resources\">3. Resources<\/span><\/h2>\n<h3><span id=\"31_Source_code\">3.1. Source code<\/span><\/h3>\n<ul>\n<li>Github repository \u2013 <a title=\"https:\/\/github.com\/podcastpedia\/css-generator-sass-gulp\" href=\"https:\/\/github.com\/podcastpedia\/css-generator-sass-gulp\" target=\"_blank\">https:\/\/github.com\/podcastpedia\/css-generator-sass-gulp<\/a><\/li>\n<\/ul>\n<h3><span id=\"32_Codingpediaorg_related\">3.2. Codingpedia.org related<\/span><\/h3>\n<ul>\n<li><a title=\"http:\/\/www.codingpedia.org\/ama\/css-preprocessors-introducing-sass-to-podcastpedia-org\/\" href=\"http:\/\/www.codingpedia.org\/ama\/css-preprocessors-introducing-sass-to-podcastpedia-org\/\" target=\"_blank\">CSS Preprocessors \u2013 Introducing Sass to Podcastpedia.org<\/a><\/li>\n<\/ul>\n<h3><span id=\"33_Web\">3.3. Web<\/span><\/h3>\n<ol>\n<li><a title=\"http:\/\/nodejs.org\/\" href=\"http:\/\/nodejs.org\/\" target=\"_blank\">nodejs<\/a><\/li>\n<li><a title=\"http:\/\/gulpjs.com\/\" href=\"http:\/\/gulpjs.com\/\" target=\"_blank\">gulpjs<\/a><\/li>\n<li><a title=\"http:\/\/gulpjs.com\/plugins\/\" href=\"http:\/\/gulpjs.com\/plugins\/\" target=\"_blank\">gulp plugins<\/a><\/li>\n<li><a title=\"https:\/\/www.npmjs.org\/doc\/json.html\" href=\"https:\/\/www.npmjs.org\/doc\/json.html\" target=\"_blank\">package.json<\/a><\/li>\n<li><a title=\"http:\/\/markgoodyear.com\/2014\/01\/getting-started-with-gulp\/\" href=\"http:\/\/markgoodyear.com\/2014\/01\/getting-started-with-gulp\/\" target=\"_blank\">Getting started with Gulp<\/a><\/li>\n<li><a title=\"http:\/\/danreev.es\/posts\/getting-started-with-gulp\/\" href=\"http:\/\/danreev.es\/posts\/getting-started-with-gulp\/\" target=\"_blank\">Getting Started With Gulp.js<\/a><\/li>\n<li><a title=\"https:\/\/github.com\/substack\/stream-handbook\" href=\"https:\/\/github.com\/substack\/stream-handbook\" target=\"_blank\">Stream-handbook<\/a><\/li>\n<li><a title=\"http:\/\/slides.com\/contra\/gulp\" href=\"http:\/\/slides.com\/contra\/gulp\" target=\"_blank\">Gulp \u2013 the streaming build system [presentation]<\/a><\/li>\n<\/ol>\n<div class=\"attribution\">\n<table>\n<tbody>\n<tr>\n<td><span class=\"reference\">Reference: <\/span><\/td>\n<td><a href=\"http:\/\/www.codingpedia.org\/ama\/how-to-use-gulp-to-generate-css-from-sass-scss\/\">How to use Gulp to generate CSS from Sass\/scss<\/a> from our <a href=\"http:\/\/www.webcodegeeks.com\/wcg\/\">WCG partner<\/a> Adrian Matei at the <a href=\"http:\/\/www.codingpedia.org\/\">Codingpedia.org<\/a> blog.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Contents 1. Set up the infrastructure 1.1. Install Node.js 1.2. Install gulp 1.2.1. Install gulp globally 1.2.2. Install gulp in your project devDependencies: 1.2.3. Create a gulpfile.js at the root of the project: 1.2.4. Run gulp 1.3. Install Gulp plugins 2. gulpfile.js 2.1. Load the modules 2.2. Gulp &hellip;<\/p>\n","protected":false},"author":21,"featured_media":913,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[46],"class_list":["post-1132","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-css","tag-gulp"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to use Gulp to generate CSS from Sass\/scss - Web Code Geeks - 2026<\/title>\n<meta name=\"description\" content=\"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Contents 1. Set up the infrastructure 1.1. Install Node.js 1.2. Install gulp 1.2.1. Install gulp globally\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.webcodegeeks.com\/css\/how-to-use-gulp-to-generate-css-from-sassscss\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to use Gulp to generate CSS from Sass\/scss - Web Code Geeks - 2026\" \/>\n<meta property=\"og:description\" content=\"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Contents 1. Set up the infrastructure 1.1. Install Node.js 1.2. Install gulp 1.2.1. Install gulp globally\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.webcodegeeks.com\/css\/how-to-use-gulp-to-generate-css-from-sassscss\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webcodegeeks\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/Codingpedia\" \/>\n<meta property=\"article:published_time\" content=\"2014-10-12T01:00:22+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/gulpjs-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Adrian Matei\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/codingpedia\" \/>\n<meta name=\"twitter:site\" content=\"@webcodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Adrian Matei\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.webcodegeeks.com\/css\/how-to-use-gulp-to-generate-css-from-sassscss\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/css\/how-to-use-gulp-to-generate-css-from-sassscss\/\"},\"author\":{\"name\":\"Adrian Matei\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/6bb4392636ae3aa3868f0908c3d6f5bd\"},\"headline\":\"How to use Gulp to generate CSS from Sass\/scss\",\"datePublished\":\"2014-10-12T01:00:22+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/css\/how-to-use-gulp-to-generate-css-from-sassscss\/\"},\"wordCount\":1178,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/css\/how-to-use-gulp-to-generate-css-from-sassscss\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/gulpjs-logo.jpg\",\"keywords\":[\"Gulp\"],\"articleSection\":[\"CSS\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.webcodegeeks.com\/css\/how-to-use-gulp-to-generate-css-from-sassscss\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.webcodegeeks.com\/css\/how-to-use-gulp-to-generate-css-from-sassscss\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/css\/how-to-use-gulp-to-generate-css-from-sassscss\/\",\"name\":\"How to use Gulp to generate CSS from Sass\/scss - Web Code Geeks - 2026\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/css\/how-to-use-gulp-to-generate-css-from-sassscss\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/css\/how-to-use-gulp-to-generate-css-from-sassscss\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/gulpjs-logo.jpg\",\"datePublished\":\"2014-10-12T01:00:22+00:00\",\"description\":\"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Contents 1. Set up the infrastructure 1.1. Install Node.js 1.2. Install gulp 1.2.1. Install gulp globally\",\"breadcrumb\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/css\/how-to-use-gulp-to-generate-css-from-sassscss\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.webcodegeeks.com\/css\/how-to-use-gulp-to-generate-css-from-sassscss\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/css\/how-to-use-gulp-to-generate-css-from-sassscss\/#primaryimage\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/gulpjs-logo.jpg\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/gulpjs-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.webcodegeeks.com\/css\/how-to-use-gulp-to-generate-css-from-sassscss\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.webcodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"CSS\",\"item\":\"https:\/\/www.webcodegeeks.com\/category\/css\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"How to use Gulp to generate CSS from Sass\/scss\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"name\":\"Web Code Geeks\",\"description\":\"Web Developers Resource Center\",\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.webcodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webcodegeeks\",\"https:\/\/x.com\/webcodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/6bb4392636ae3aa3868f0908c3d6f5bd\",\"name\":\"Adrian Matei\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/07530896497ff3198e54e4560275c4332254a4ab2a17c60a6f0db098ed531aba?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/07530896497ff3198e54e4560275c4332254a4ab2a17c60a6f0db098ed531aba?s=96&d=mm&r=g\",\"caption\":\"Adrian Matei\"},\"description\":\"Adrian Matei (ama [AT] codingpedia DOT org) is the founder of Podcastpedia.org and Codingpedia.org, computer science engineer, husband, father, curious and passionate about science, computers, software, education, economics, social equity, philosophy.\",\"sameAs\":[\"http:\/\/www.codingpedia.org\/\",\"https:\/\/www.facebook.com\/Codingpedia\",\"https:\/\/www.linkedin.com\/in\/adrianmatei1983\",\"https:\/\/x.com\/https:\/\/twitter.com\/codingpedia\"],\"url\":\"https:\/\/www.webcodegeeks.com\/author\/adrian-matei\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to use Gulp to generate CSS from Sass\/scss - Web Code Geeks - 2026","description":"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Contents 1. Set up the infrastructure 1.1. Install Node.js 1.2. Install gulp 1.2.1. Install gulp globally","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.webcodegeeks.com\/css\/how-to-use-gulp-to-generate-css-from-sassscss\/","og_locale":"en_US","og_type":"article","og_title":"How to use Gulp to generate CSS from Sass\/scss - Web Code Geeks - 2026","og_description":"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Contents 1. Set up the infrastructure 1.1. Install Node.js 1.2. Install gulp 1.2.1. Install gulp globally","og_url":"https:\/\/www.webcodegeeks.com\/css\/how-to-use-gulp-to-generate-css-from-sassscss\/","og_site_name":"Web Code Geeks","article_publisher":"https:\/\/www.facebook.com\/webcodegeeks","article_author":"https:\/\/www.facebook.com\/Codingpedia","article_published_time":"2014-10-12T01:00:22+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/gulpjs-logo.jpg","type":"image\/jpeg"}],"author":"Adrian Matei","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/codingpedia","twitter_site":"@webcodegeeks","twitter_misc":{"Written by":"Adrian Matei","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.webcodegeeks.com\/css\/how-to-use-gulp-to-generate-css-from-sassscss\/#article","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/css\/how-to-use-gulp-to-generate-css-from-sassscss\/"},"author":{"name":"Adrian Matei","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/6bb4392636ae3aa3868f0908c3d6f5bd"},"headline":"How to use Gulp to generate CSS from Sass\/scss","datePublished":"2014-10-12T01:00:22+00:00","mainEntityOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/css\/how-to-use-gulp-to-generate-css-from-sassscss\/"},"wordCount":1178,"commentCount":0,"publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/css\/how-to-use-gulp-to-generate-css-from-sassscss\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/gulpjs-logo.jpg","keywords":["Gulp"],"articleSection":["CSS"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.webcodegeeks.com\/css\/how-to-use-gulp-to-generate-css-from-sassscss\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.webcodegeeks.com\/css\/how-to-use-gulp-to-generate-css-from-sassscss\/","url":"https:\/\/www.webcodegeeks.com\/css\/how-to-use-gulp-to-generate-css-from-sassscss\/","name":"How to use Gulp to generate CSS from Sass\/scss - Web Code Geeks - 2026","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/css\/how-to-use-gulp-to-generate-css-from-sassscss\/#primaryimage"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/css\/how-to-use-gulp-to-generate-css-from-sassscss\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/gulpjs-logo.jpg","datePublished":"2014-10-12T01:00:22+00:00","description":"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Contents 1. Set up the infrastructure 1.1. Install Node.js 1.2. Install gulp 1.2.1. Install gulp globally","breadcrumb":{"@id":"https:\/\/www.webcodegeeks.com\/css\/how-to-use-gulp-to-generate-css-from-sassscss\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.webcodegeeks.com\/css\/how-to-use-gulp-to-generate-css-from-sassscss\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/css\/how-to-use-gulp-to-generate-css-from-sassscss\/#primaryimage","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/gulpjs-logo.jpg","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/gulpjs-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.webcodegeeks.com\/css\/how-to-use-gulp-to-generate-css-from-sassscss\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.webcodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"CSS","item":"https:\/\/www.webcodegeeks.com\/category\/css\/"},{"@type":"ListItem","position":3,"name":"How to use Gulp to generate CSS from Sass\/scss"}]},{"@type":"WebSite","@id":"https:\/\/www.webcodegeeks.com\/#website","url":"https:\/\/www.webcodegeeks.com\/","name":"Web Code Geeks","description":"Web Developers Resource Center","publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.webcodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.webcodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.webcodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webcodegeeks","https:\/\/x.com\/webcodegeeks"]},{"@type":"Person","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/6bb4392636ae3aa3868f0908c3d6f5bd","name":"Adrian Matei","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/07530896497ff3198e54e4560275c4332254a4ab2a17c60a6f0db098ed531aba?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/07530896497ff3198e54e4560275c4332254a4ab2a17c60a6f0db098ed531aba?s=96&d=mm&r=g","caption":"Adrian Matei"},"description":"Adrian Matei (ama [AT] codingpedia DOT org) is the founder of Podcastpedia.org and Codingpedia.org, computer science engineer, husband, father, curious and passionate about science, computers, software, education, economics, social equity, philosophy.","sameAs":["http:\/\/www.codingpedia.org\/","https:\/\/www.facebook.com\/Codingpedia","https:\/\/www.linkedin.com\/in\/adrianmatei1983","https:\/\/x.com\/https:\/\/twitter.com\/codingpedia"],"url":"https:\/\/www.webcodegeeks.com\/author\/adrian-matei\/"}]}},"_links":{"self":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/1132","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/users\/21"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/comments?post=1132"}],"version-history":[{"count":0,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/1132\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media\/913"}],"wp:attachment":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media?parent=1132"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/categories?post=1132"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/tags?post=1132"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}