Simple gulp boilerplate for beginners.
Helps you to automate some common tasks:
- minify js and css
- bundle js (uses webpack)
- archive dist
- svg and png sprites assembly
- Pug templates compilation
# Clone repo
git clone https://github.com/qprquo/gulp-starter-boilerplate
# cd to directory
cd gulp-starter-boilerplate
# link package
npm link
# Create project
gulp-starter-boilerplate --create=<name>
# install packages
cd <name>
npm install
# start some task
gulp watch
gulp build
- build in development mode (with sourcemaps)gulp prod
- build in production mode (without sourcemaps)gulp zip
- archive${config.dist}
directorygulp watch
- start dev server and watch for changesgulp clean
- clean dist folder
Following options are available:
const config = {
// output directory
dist: './dist/',
// minify css and put files in `${config.dist}/css` directory
minifyCss: true,
// minify js and put files in `${config.dist}/js` directory
minifyJs: true,
// use webpack. If set to `true` then bundles js using config located in project root
useWebpack:false
// compile png sprites located in ./sprites/png directory
pngSprites: true,
// compile svg sprites located in ./sprites/svg directory
svgSprites: true
}
Or you can edit gulpfile.js on your own.