https://github.com/dpmango/gulp-starter-pack (author url)
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
https://projectname.surge.sh (change name in package.json)
yarn- install npm dependenciesgulp- run dev-servergulp build- build project from sources
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.
| 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) |
| 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 |
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.
gulp --openorgulp server --open- run dev server and then open preview in browsergulp --tunnel=[name]orgulp 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] --prodorgulp [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 builduses this mode by default.
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 to do the same, but it will run gulp build first and deploy production version of build (mostly about minified assets)
You can also use npm scripts:
yarn start- same asgulp default.yarn build- same asgulp build.yarn surge- deploy./distfolder to surge (used for previews). Request deploy rights from owner (surge --add friend@email.co)