First, save the file "gulpfile.js" and "package.json" in the project root folder. Then run on the terminal:
npm install
This command will install all dependences in your project to run the Gulp file.
- Creating a package.json file
npm init
- To install SASS (as global)
npm install sass
- To install Gulp (as global)
npm install --global gulp
- To install Gulp Sass (Dev enviroment)
npm install -D gulp-sass
- To install Gulp Clean CSS (Dev Enviroment)
npm install -D gulp-clean-css
The dev dependenses will just be used in development enviroment and will not be sended to production.
- gulp-sass: used to compile Scss files to CSS
- gulp-clean-css: used to minify the CSS files
With the dependenses intalled, you just need to run the follow command on the terminal:
gulp
This project acess the folder "./src/sass" and compile all the files with the extention ".scss", even inside other folder, and create the folder/file inside a folder called "css" outside the src folder.
If you want to change the path, you just need to change the path inside functions ".src" and "dest" on the task "compile" inside the file "gulpfile.js".