Skip to content

brianhaferkamp/20-mile-head-start

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The 20-Mile Head Start

A modern, Gulp-based front end development build process for HTML, CSS, and JS websites

Requirements

This project have some requirements you need to meet in order to compile it. First of all, you need NodeJS in order to run JavaScript on the console, you can go to the NodeJS site and follow trough the installation process. After you get the node command on the console, you need to install Gulp and Bower globally with the following command.

npm install -g gulp

Gulp is the one that will run all the compilation, watchers and others tasks.

Install

To get started, open the console and change the directory to the project folder. Execute the following command in the console to install all of the necessary npm modules:

npm install

After the process finishes you will have all you need to start coding.

How to use

Go to the project folder in the console and run gulp start. It will compile the project and start a server that will refresh every time you change something in the code. Gulp will be watching for changes and will tell you how to access the project from a local and public url. Every browser that points to that URL will be auto refreshed. As an extra feature for testing purposes any interaction on one browser will be reflected on any others. Try it on a phone, tablet and pc at the same time by connecting your devices to the external URL provided by the server.

Here are the commands available with this build process. You can also set up specific commands to do individual tasks in gulpfile.js.

  • gulp start: Compile and watch for changes
  • gulp clean: Removes all the compiled files in /build

Structure

The project has a very simple and flexible structure. If the default place for any file or directory needs to be moved, be sure to update to the new position in the config.js file.

├───build -> All the compiled files will be placed here (Distribution)
│   ├───assets -> Compiled Assets
|   |   ├───css -> Compiled CSS files
|   |   ├───js -> Compiled JS files
|   |   ├───img -> Image files
|   |   └───downloads -> Files that can be linked to/downloaded
│   ├───index.html -> Compiled Pug files
├───source -> Source files for the project
│   ├───assets -> Assets for the project
│   │   ├───img -> Images
│   │   ├───js -> Scripts
|   |   └───downloads -> Files that can be linked to/downloaded
│   ├───sass -> Sass styles
│   │   └───main.sass -> Main file in where all other SASS files should be included.
│   └───views -> Templates directory for Pug files
│   │   └───index.pug
├───package.json -> NodeJS configuration file for managing Node dependencies
├───gulpfile.js -> Gulp Tasks

All the files in the build folder will be auto-generated by the different tasks when the project compiles. Be sure to not modify any file manually in the build folder because changes will be overwritten during the compile process.

Service Worker

A service worker has been added that allows you to offer users offline browsing of your website and file caching. To use the service worker, simply copy (or move) sw.js and manifest.json to the root of the /build folder. Learn more about configuration of the service worker used in this build system by watching this video on YouTube or you can view Google's service worker documentation.

Credits

Author: Brian Haferkamp

Questions or comments

Email or contact Brian on Twitter

About

An HTML website build system that includes Pug (formerly Jade), Gulp, SASS, and BrowserSync

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published