Skip to content

stephenpearce/gulp-starter-pack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gulp Starter Pack

An optionated gulp environment for serving simple static projects.

Prerequisites

Consider getting these using nvm-windows on Windows, homebrew on macOS and linuxbrew on Linux.

Setup Instructions

  1. Clone this repository:

    git clone https://github.com/stephenpearce/gulp-starter-pack.git
    cd gulp-starter-pack
  2. Install dependencies:

    npm install

Available Commands / Tasks

Run the following command to start a development server with live reloading:

gulp

This default task cleans the dist/ folder, builds the project, starts a local server, and watches for changes in source files.

To build the project without starting a development server, run:

gulp build

This task cleans the dist/ folder and builds the project for production deployment.

gulp clean

This cleans the dist/ directory to prepare for a fresh build.

gulp html

This minifies the HTML, replaces references to CSS and JavaScript files with their minified versions, and copies them to dist/.

gulp css

This minifies the CSS files, adds a .min suffix to the filename, generates source maps and copies them to dist/css/.

gulp js

This minifies the JavaScript files, adds a .min suffix to the filename, generates source maps and copies them to dist/js/.

gulp images

This crunches images using imagemin and copies them to the dist/img/ directory.

gulp watch

This watches for changes in HTML, CSS, JavaScript, and image files, triggers corresponding tasks and reloads the browser.

Configuration

  • Source Files: Place your HTML, CSS, JavaScript and image files in their respective directories under src/. Simple "hello world" examples are given as placeholders.

  • Distribution: Optimized files are output to dist/.