Giter Site home page Giter Site logo

ggwin-webpack's Introduction

Gulp Starter Pack

This package intended to solve common front-end development tasks. Works best for psd/sketch to html projects and save you a lot of time setting up local environment

How to start

  • yarn or npm i - install npm dependencies
  • gulp - run dev-server
  • gulp build - build project from sources
  • yarn deploy or npm run deploy - run build and deploy to surge

List of Gulp tasks

To run separate task type in command line gulp [task_name]. Almost all tasks also have watch mode - gulp [task_name]:watch, but you don't need to use it directly.

Main tasks

Task name Description
default will start all tasks required by project in dev mode: initial build, watch files, run server with livereload
build:development build dev version of project (without code optimizations)
build build production-ready project (with code optimizations)

Other tasks

Task name Description
sass compile .sass/.scss to .css. Included postcss for autoprefixer, flexbugs and other cool plugins you might add
pug compile pug templates
javascript combines vendor files and custom .js code into separate files
sprite:svg create svg symbol sprites (monocolor and multicolor)
sprite:png create png sprites
images optimize, minify and clone images
server run dev-server powered by BrowserSync
clean remove ./dist folder
copy copy common files from ./src path to ./dist path
list-pages create index file with links to all project pages

All available tasks are placed in a folder ./gulp/tasks as separate .js files.

General instructions

  • Layout is based on components. ./src/components include folders named by blocks. Each block have _name.pug file and _name.{sass,scss} stylesheet

Flags

  • gulp --open or gulp server --open - run dev server and then open preview in browser
  • gulp --tunnel=[name] or gulp server --tunnel [name] - runs dev server and allows you to easily share a web service on your local development machine (powered by localtunnel.me). Your local site will be available at [name].localtunnel.me.
  • gulp [task_name] --prod or gulp [task_name] --production - run task in production mode. Some of the tasks (like, sass or js compilation) have additional settings for production mode (such as code minification), so with this flag you can force production mode. gulp build uses this mode by default.

Deploy

There are git hooks for surge deploy. Every push will execute deploy to specific surge domain of ./dist folder

Exmaple: surge --project ./dist --domain projectname.surge.sh

If it's not working correctly, try installing git-scripts manually: yarn add git-scripts --save

use yarn surge or npm run surge to do the same. deploy command will run build with production flag and upload to surge

Other

You can also use npm scripts:

  • yarn start or npm start - same as gulp default.
  • yarn build or npm run build - same as gulp build.
  • yarn surge or npm run surge - deploy ./dist folder to surge (used for previews). Request deploy rights from owner (surge --add [email protected])

ggwin-webpack's People

Contributors

itjustalance avatar

Watchers

 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.