actum / gulp-dev-stack

Actum dev stack based on gulp
MIT License
11 stars 7 forks source link

Front-end development stack used at Actum to create beautiful things.

Summary

Features

🛠 Preprocessing Linting Postprocessing
CSS SASS Stylelint PostCSS (autoprefixer, cssnano)
Sourcemaps
JavaScript Babel ESLint Browserify
Watchify
Uglify
Sourcemaps
SVG SVGStore
svgmin
Images imagemin
Favicons gulp-real-favicon
HTML Nunjucks Prettify
Dev server browser-sync
API mocking json-server

Getting started

Preparations

  1. This development stack uses Node, so make sure you have it installed.
  2. Install Gulp globally:
    npm install -g gulp

Setup

  1. Clone the repository: git clone https://github.com/actum/gulp-dev-stack ./PROJECT_NAME

  2. Install package dependencies with npm install under the root of your PROJECT_NAME folder.

  3. Configure the project. Do not forget to change the respective keys in package.json according to your project’s info, and setup a unique listening port in ./gulp/config.js.

Project structure

Following a certain file and folder structure keeps development, maintenance and debugging processes much easier when switching from project to project based on the same development stack.

Workflow

Development

To start your development process, run gulp --dev in the terminal. This will prepare the project for the work and launch watch tasks to update the files on-the-fly as you work. A --dev flag will notify the automatization tasks to add or omit certain steps (i.e. your JavaScript files are not minified while in development mode).

API mock server

If you want to start also an API server, run gulp --dev --api. This server will run on different port which is defined in gulp/config.js as API_PORT.

Mokker

If you want to start Mokker, run gulp server. This server will run on different port which is defined in gulp/config.js as MOCK_PORT.

Remove built targets

If you want to revert back to a fresh state without built files, run

gulp clean

It will remove the dist/ folder and all built targets in src/.

Production build

To prepare production-ready files, run gulp and grab built assets from dist folder.

Updates from devstack to your project

Debugging with Visual Studio Code Debugger for Chrome

Support for extension Debugger for Chrome is enabled! Big thanks to roblourens

  1. Install extension Debugger for Chrome
  2. Run project in development mode
  3. Run Debugger for Chrome by F5 key (in Windows)

visual studio code chrome debugger

Troubleshooting

Common errors
Error: "Local gulp not found in ..." when running gulp.
Solution: Make sure you run npm install after cloning the repository.

When you have encountered a bug, or have a useful suggestion how to improve this development stack, do not hesitate to Create a new issue.