Giter VIP home page Giter VIP logo

gulp-4-sass's Introduction

Gulp 4 build for projects which using SASS(SCSS)/LESS/Stylus and JS

Project Description:

Using these files, you can quickly configure the build of your project on Gulp.

This build includes:

Prerequisites

Install Node JS

Install Git

How to use this build?

Open cmd on Windows or Terminal on Linux/MacOS and follow next steps:

  • install gulp globally - npm install --global gulp-cli
  • download build - git clone https://github.com/alexhamenko/gulp-4-sass
  • go to the project folder - cd gulp-4-sass
  • install packages from package.json - npm i
  • run gulp command to make sure everything is installed correctly

Files structure

./src

/css

/main.scss  
/media.scss  

/js

/lib.js  
/main.js  

./gulpfile.js
./package.json
./index.html

main.scss, media.scss, lib.js and main.js - these files are used for verifying the correct work of the build. To use your own file, add it to the src/css or src/js folder and edit correct the corresponding lines in the cssFiles and jsFiles variables fromgulpfile.js.

If you want to use LESS or Stylus preprocessors instead of SASS, do the following steps after downloading this project:

LESS:

  1. Go to the project folder - cd gulp-4-sass
  2. Run command npm i
  3. Run command npm i -SD gulp-less
  4. Run command npm uninstall gulp-sass -SD
  5. Change extensions of style files from scss to less in the src/css folder
  6. Replace SCSS code with LESS code in the style files from src/css folder
  7. Edit gulpfile.js:
    • change const sass = require('gulp-sass'); to const less = require('gulp-less');
    • change files extensions from scss to less in the const cssFiles
    • change .pipe(sass()) to the .pipe(less()) in the styles() function
    • change gulp.watch('./src/css/**/*.sass', styles); to the gulp.watch('./src/css/**/*.less', styles); in the watch() function
    • delete gulp.watch('./src/css/**/*.scss', styles);

Stylus:

  1. Go to the project folder - cd gulp-4-sass
  2. Run command npm i
  3. Run command npm i -SD gulp-stylus
  4. Run command npm uninstall -SD gulp-sass
  5. Change extensions of style files from scss to styl in the src/css folder
  6. Replace SCSS code with Stylus code in the style files from src/css folder
  7. Edit gulpfile.js:
    • change const sass = require('gulp-sass'); to const stylus = require('gulp-stylus');
    • change file's extensions from scss to styl in the const cssFiles
    • change .pipe(sass()) to .pipe(stylus()) in the styles() function
    • change gulp.watch('./src/css/**/*.sass', styles); to the gulp.watch('./src/css/**/*.styl', styles); in the watch() function
    • delete gulp.watch('./src/css/**/*.scss', styles);

Based on this build

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.