Buy now
Working with Gulp
As has been mentioned in previous section, Gulp is a JavaScript task runner. It helps with performing repetitive tasks like minification, compilation, unit testing, linting, etc. This is possible thanks to extensive Gulp Plugins library.
Gulp tasks are already set up for you. They are stored inside Cartzilla/gulpfile.js. But in order to have access to them via you Command Line tool you will need to install gulp-cli node package. Gulp CLI stands for Gulp Command Line Interface.
To do that type following line in your terminal:
Gulp CLI commands
- gulp - this main command will fire default gulp task which includes: launching BrowserSync, vendor files concatination, javascript minification, sass and pug compilation and lanching watch task. BrowserSync will create dev server and sync your browser with your code editor. Note: to use other separate tasks explained below you will need to open other Terminal window and leave this one with running server intact.
- gulp concat:js - concatination vendor
.jsfiles found insidevendorfolder in onevendor.min.jsfile which are linked to your HTML document. - gulp concat:css - concatination vendor
.cssfiles found insidevendorfolder in onevendor.min.cssfile which are linked to your HTML document. - gulp uglify - minify and uglify main
theme.jsfile fromsrcfolder todist/js/theme.min.jsfile which linked to your HTML document. - gulp pug - compiles
.pugtemplate files into HTML. Again fromsrctodistfolder. - gulp sass:expanded - compiles
.scssfiles into non-minified CSS (css/theme.css). Fromsrctodistfolder. - gulp sass:minified - compiles
.scssfiles into minified CSS (css/theme.min.css). Fromsrctodistfolder. - gulp watch - launches
watchtask. It will watch changes of your .scss / .js / .pug files and automatically compile them into .css / .js / .html.
Next steps
Now you when you are equiped with all necessary tools and dev invironment is all set you are ready to dive into Cartzilla customization.
Take some time to familiarize yourself with Project Structure.