There are two main tasks, combining multiple other tasks. Those tasks are defined in gulpfile.babel.js - and those two ones are the ones you are gonna use the most:
This is the task you start when developing:
gulp. Use this address for developing, copy and paste it in your browser(s) of choice and start on any device on the same network.The main task for creating a production-ready version of your sources:
Every other task (or task-group) can be found in the ./tasks/-folder. Every file in there will be loaded automatically, this way you can just create a new file in ./tasks/ to add your own tasks for gulp.
Pre-configured tasks are (in alphabetical order):
This task will remove all temporary files created and every file that will be compiled/copied.
There are multiple tasks avaiable for copying files around:
Those tasks will produce the main.js and main.min.js files, using rollup as a bundler. The non-minified version produced by the javascripts:development-task contains a sourcemap for easy debugging, the one generated by javascripts:production will be minified with uglifyjs.
There are three different types of tasks avaiable for linting your html, sass and js-files, and for each on of those tasks, there is a :development and a :production-flavor — the development-tasks don’t break your build (useful while watching files), whereas the :production-ones will throw an error and kill the build-process:
The task sass:development is used in the default gulp watch task. This task will recompile sass and add a sourcemap for easy debugging. This task creates the unminified, fully expanded main.css-file and tells Browsersync to reload, if anything changes.
stylesheets:production creates the minified main.min.css file, without any sourcemaps.
Both tasks use the autoprefixer and normalize postcss-plugins to automatically add vendor-prefixes and normalization after sass-compilation.
This task downloads all pages specified in package.json kalong.pages and saves them as temporary files to your public root-folder. This task is used in the lint:html-task (for checking your html).
Starts a browsersync-instance and is used in the default gulp-task.
TODO: rewrite This task creates a shared.json-file from the specified scss-files from config.shared. Only basic sass-maps and variables are supported. This is just a simple regexp-task, converting scss-files (with only variables in it) to one json-file, which then can be used with JS.
TODO This task uses the gulp-plugin gulp-svg-sprite to create a simple sprite from all SVG-files, that you copy to the ./src/img/sprites/-folder. This tasks generates a sprites.svg-file (the actual sprite) and a scss-file in ./src/scss/vendor/_sprites.scss.
The generated sprite is very basic (and at the core just a pimped png-sprite — you still have to create every icon with every color) but can easily be used with the generated mixin. You can change the file ./src/tmpl/sprites.scss to influence the scss-output.
This is a work in progress, and when we can finally ditch IE9-support, I will revisit this (or use sth. like grumpicon instead…)