Aurelia CLI Is Now Webpack First

Last updated: March 21, 2018

One of my favourite Aurelia changes isn’t a new feature, nor is it a long-awaited bug fix or new tool: it’s the fact the CLI now supports Webpack by default.

Why is this a big deal? Previously, the CLI took a RequireJS first approach to bootstrapping new applications, meaning if you didn’t choose to customise your au new generated application, you would get RequireJS as your default bundler.

Now, there isn’t anything wrong with RequireJS as a bundler, but the issue with RequireJS is given its age there are issues dealing with different file formats, especially styles and static assets like images and fonts (which it cannot handle).

Whereas, Webpack can handle every single file format type in existence without blinking an eye. If you need to support it, either Webpack supports it out-of-the-box or you can download a file loader to add in support and a simple module rule definition from within your webpack.config.js file.

While RequireJS can handle CSS and Javascript (it’s showing its age even in this department), it cannot handle a lot of other formats, which is why the RequireJS CLI apps would use Gulp and some various build tasks to copy things like fonts and images.

The performance of Webpack in comparison to RequireJS? There is no comparison, Webpack might be more daunting, but it wins in speed (especially Webpack 4).

Purchase Aurelia for Real World Applications over at Leanpub now

 

Dwayne

 

One thought on “Aurelia CLI Is Now Webpack First

  1. Nice – working on a angular over aspnet core app, and would like to explore moving to Anrelia (as an ex CM WFP person) – this will take the pain away… are you updating your book in-line with this?

Leave a Reply

Your email address will not be published. Required fields are marked *