All Projects โ†’ neutraltone โ†’ gulp-boilerplate

neutraltone / gulp-boilerplate

Licence: MIT license
๐Ÿš€ A opinionated gulp boilerplate for individuals and teams

Programming Languages

CSS
56736 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to gulp-boilerplate

Blendid
A delicious blend of gulp tasks combined into a configurable asset pipeline and static site builder
Stars: โœญ 5,026 (+27822.22%)
Mutual labels:  gulp, svg-sprites
external-svg-sprite-loader
A webpack loader and plugin that generate SVG sprites out of a collection of SVG files used in your JS and CSS files
Stars: โœญ 60 (+233.33%)
Mutual labels:  svg-files, svg-sprites
Hugo theme pickles
Modern, Simple and beautiful Hugo theme
Stars: โœญ 168 (+833.33%)
Mutual labels:  gulp, svg-sprites
sass-starter-pack
Sass starter files using Gulp v4.0.0 ๐Ÿ”ฅ
Stars: โœญ 34 (+88.89%)
Mutual labels:  gulp, sass-files
Gulp Webpack Starter
Gulp Webpack Starter - fast static website builder. The starter uses gulp toolkit and webpack bundler. Download to get an awesome development experience!
Stars: โœญ 199 (+1005.56%)
Mutual labels:  gulp, svg-sprites
sage-starter
The best starter theme with a modern front-end development workflow. Based on Sage, HTML5 Boilerplate, gulp, Bower, and Bootstrap.
Stars: โœญ 42 (+133.33%)
Mutual labels:  gulp, svg-sprites
gulp-webpack-demo
No description or website provided.
Stars: โœญ 12 (-33.33%)
Mutual labels:  gulp
bibleapi-rest
Node.js based Bible API RESTful web service
Stars: โœญ 34 (+88.89%)
Mutual labels:  gulp
gulp-optimize-js
No description or website provided.
Stars: โœญ 23 (+27.78%)
Mutual labels:  gulp
wx-mini
่ฟ็”จwebpack็ผ–่ฏ‘ๆž„ๅปบๅฐ็จ‹ๅบ็š„่„šๆ‰‹ๆžถ๏ผˆ็จณๅฎš็‰ˆ๏ผ‰
Stars: โœญ 21 (+16.67%)
Mutual labels:  gulp
envoyer-npm-deployment
Compile assets that depend on node packages using Laravel Envoyer deployment hooks
Stars: โœญ 43 (+138.89%)
Mutual labels:  gulp
svg2vector
Online batch converter of SVG images to Android vector drawable XML resource files
Stars: โœญ 39 (+116.67%)
Mutual labels:  svg-files
streetsupport-web
Helping people facing homelessness across the UK to find services in their area, and connecting people who want to help to where it is needed most.
Stars: โœญ 21 (+16.67%)
Mutual labels:  gulp
docker-npm
npm, yarn, node, npx, bower, grunt, gulp, generate-md - build and dev tools.
Stars: โœญ 53 (+194.44%)
Mutual labels:  gulp
manage-demo
ๅŽๅฐ็ฎก็†็ณป็ปŸๆจก็‰ˆ
Stars: โœญ 19 (+5.56%)
Mutual labels:  gulp
gulp-tinypng-compress
TinyPNG API wrapper for compressing PNG & JPG images
Stars: โœญ 49 (+172.22%)
Mutual labels:  gulp
fly-helper
It's a Tool library, method collection
Stars: โœญ 21 (+16.67%)
Mutual labels:  gulp
gulp-twig-scss
Gulp, Twig and SCSS
Stars: โœญ 15 (-16.67%)
Mutual labels:  gulp
electron-angular-ngrx
An Angular (6x) Electron seed featuring @angular/cli, @ngrx/platform, and Typescript. Complete with HMR workflow
Stars: โœญ 39 (+116.67%)
Mutual labels:  gulp
pacco
A bundler for modular and extensible web projects.
Stars: โœญ 16 (-11.11%)
Mutual labels:  gulp

gulp-boilerplate

A gulp ITCSS Sass based boilerplate for individuals and teams.

Lints and concatenates JS files. Compiles Sass files and automatically adds vendor prefixes. Exports both minified JS and CSS files with header info. Generates SVG sprites.

Download Gulp Boilerplate

Contents

Getting Started

Dependencies

Make sure these are installed first.

Quick Start

  1. In bash/terminal/command line, cd into your project directory.
  2. Run npm install to install required files.
  3. When it's done installing, run one of the task runners to get going:
  • npm start automatically watch for changes and compile files, lints JavaScript and server and synchronise changes to the browser via Browsersync accordingly;
  • npm run lint:sass lints your sass using stylelint. Rules can be found in the .stylelint config file.
  • npm run lint:js lints your JavaScript using eslint. Rules can be found in the .eslintrc config file.
  • npm run build manually compile files and lint JavaScript without serving the files to the browser.
  • npm run build:sass manually compiles just your sass.
  • npm run build:js manually compiles just your JavaScript.
  • npm run build:images manually optimizes just your images.
  • npm run build:svg-sprite manually compiles all your SVG's in a SVG sprite.

File Structure

Add your files to the appropriate src subdirectories. Gulp will process and and compile them into dist.

  • Content in subdirectories under the js directory will be concatenated;
  • Image files (including svg files) placed in the img directory will be optimised and copied into the dist/assets/img directory;
  • SVG files placed in the src/sprite directory will be optimized and compiled into the dist/assets/img directory as a sprite.svg file.
gulp-boilerplate/
โ”œโ”€โ”€ dist/
โ”‚   โ”œโ”€โ”€ assets/
โ”‚   โ”‚   โ”œโ”€โ”€ css/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ critical.min.css
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ main.min.css
โ”‚   โ”‚   โ”œโ”€โ”€ fonts/
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ # font files
โ”‚   โ”‚   โ”œโ”€โ”€ img/
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ # image files
โ”‚   โ”‚   โ””โ”€โ”€ js/
โ”‚   โ”‚       โ””โ”€โ”€ scripts.min.js
โ”‚   โ”œโ”€โ”€ .htaccess
โ”‚   โ”œโ”€โ”€ favicon.icon
โ”‚   โ”œโ”€โ”€ humans.txt
โ”‚   โ”œโ”€โ”€ index.html
โ”‚   โ”œโ”€โ”€ manifest.json
โ”‚   โ”œโ”€โ”€ robots.txt
โ”‚   โ”œโ”€โ”€ service-worker.js
โ”‚   โ”œโ”€โ”€ # static assets
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ img/
โ”‚   โ”‚   โ”œโ”€โ”€ # image files
โ”‚   โ”‚   โ”œโ”€โ”€ touch/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ apple-touch-icon.png
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ chrome-touch-icon-192x192.png
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ icon.png
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ ms-touch-icon-144x144-precomposed.png
โ”‚   โ”œโ”€โ”€ js/
โ”‚   โ”‚   โ””โ”€โ”€ # script files
โ”‚   โ”œโ”€โ”€ scss/
โ”‚   โ””โ”€โ”€ sprite/
โ”œโ”€โ”€ .babelrc
โ”œโ”€โ”€ .editorconfig
โ”œโ”€โ”€ .eslintrc
โ”œโ”€โ”€ .gitignore
โ”œโ”€โ”€ .stylelintrc
โ”œโ”€โ”€ gulp-options.json
โ”œโ”€โ”€ gulpfile.babel.js
โ”œโ”€โ”€ LICENSE
โ”œโ”€โ”€ package.json
โ””โ”€โ”€ readme.md

Working with the Source Files

Sass

This project uses the ITCSS structure and makes use of imports to allow for a critical stylesheet to be generated alongside you main stylesheet.

Sass files are located in src > sass. Gulp generates minified and unminified CSS files. It also includes autoprefixer, which adds vendor prefixes for you if required by the last two versions of a browser.

JavaScript

JavaScript files are located in the src/js directory.

All script files placed in this directory will be concatinated and minified into a single scripts.min.js file compiled directly into the dist/assets/js directory.

Images

Image files placed in the src/img directory will be optimised and copied into the dist/assets/img directory. The src/touch directory contains some placeholder images various touch devices. These are compiled into the subdirectory dist/assets/img/touch and referenced, if required, in the head of dist/index.html.

Note: Although the images task has image optimisation enable through the imagemin plugin images can sometimes be further optimise with ImageOptim and b64.io.

SVG sprite

SVG files placed in the src/svg directory will be compiled into a single SVG sprite named sprite.svg and compiled to the dist/assets/img directory. This can then be loaded into the page with ajax via a snippet which resides in the <head> of dist/index.html.

Options and Settings

Updating Project Details

Open up package.json to change the name, version, URL and other data about the project. The following values are used in the banner which is inserted in the top of the compiled files.

  • Name;
  • Title;
  • URL;
  • Author;
  • Version;
  • License.

Changing the Directory Structure

Inside gulp-options.json you'll find a json object of directory paths. Adjust the paths to suit your workflow.

{
  "src": {
    "src": "src",
    "scss": "src/scss/**/*.scss",
    "img": "src/img/{,*/}*.{jpg,jpeg,png,gif,svg}",
    "sprite": "src/sprite/{,*/}*.svg",
    "js": "src/js/**/*.js",
    "vendor": "src/js/vendor/**/*.js"
  },
  "dest" : {
    "dist": "dist",
    "css": "dist/assets/css",
    "img": "dist/assets/img",
    "js": "dist/assets/js"
  }
}

Thanks

  • gpmd - For their ITCSS boilerplate.
  • Chris Ferdinandi - For his Gulp Boilerplate which parts of this were inspired by.

License

The code is available under the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].