Posts

Showing posts from December, 2017

How to create a custom Task using Aurelia-CLI

First of all you need to understand, how the Aurelia-CLI works and how it is usually structured. For our example we’re going to setup gulp-imagemin. Having an atomic structure where each class, service or task has dedicated responsibilities has many advantages like the following ones: You’ll always have an overview about your application, You can structure your application well with clear responsibilities, Everyone can understand your code fast and your application is more stable and maintainable. For everyone! Install gulp-imagemin To be able to setup our custom task for minifying our images, we need to install gulp-imagemin first. This can be done by the following command: au install gulp-imagemin On success this application is now listed in aurelia_project/aurelia.json . Create a Task using Aurelia-CLI console In this case my task is called “process-images”. au generate task process -images This command creates a file ‘process-images.ts’ in the default aurelia dir