Giter Club home page Giter Club logo

gulpfile.js's Introduction

gulpfile.js

simple gulpfile to get you started with using gulp, sass, browser-sync, and auto-prefixer all together

To get started

Clone this repo, download it, or copy the gulpfile.js into your project structure. Remember to put it in the root of your directory, or it won't work.

Download dependenices

Install node, then run npm init if you haven't already.

After that, run these commands below:

  • npm install gulp -g to download gulp globally
  • npm install gulp gulp-sass gulp-autoprefixer browser-sync --save-dev to download and save your dependencies in the dev section because we will not need these dependencies once you bring your application into production.

Dependencies

  • gulp : the task runner that will be running the tasks
  • gulp-sass : engine that will convert your SASS files into CSS files
  • gulp-autoprefixer : engine that will parse the generated CSS files and add vendor prefixes to CSS rules
  • browser-sync : used for cross-device testing and hot-reloading of the browser to strip manual refreshing from your workflow

File structure

If you want to hit the ground running quick, and you have a brand spanking new project, set up your file strucure as follows:

.
|____app
| |____css
| |____html
| |____scss
  • This is the way the gulp file is currently set up to work.

  • If you would like to change the file structure, or you already have a file structure set up, then you will have to change the folders that gulp is watching, otherwise, it won't be able to see your changes.

  • If you have sub folders inside the folder structure used by this gulp file, all you have to change is, before the *.(file-type), put a /**/ which will allow gulp to look into the sub-folders of the upper level folder. Very handy if you like to seperate your files into sub-folders. It will then look like, for example, app/scss/**/*.scss

Running

To run this script, all you have to do is go the root of your directory, and type in the terminal of your choice gulp and it will automatically run and open your browser at the app folder level with the directory showing.

Anytime you make a change, browsersync will automatically reload your page with the changes inside the folders it is watching.

I hope this helps you out!

gulpfile.js's People

Contributors

landonpatmore avatar

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.