CLI

The new CLI is much more powerful than the older one since it can compile single tags but it can also bundle your entire Riot.js application.

It’s designed to simplify the components bundling for quick prototypes and demos however for bigger application it’s recommended the use of highly customizable javascript bundlers together with riot loaders

Installation

In Riot.js v3 it was possible to install the CLI via npm i -g riot. In Riot.js 4 it was removed from the riot npm package and you will need to install it separately via npm i -g @riotjs/cli.

Components registration

You need to be aware that it previously was automatically registering your Riot.js components but now it will just output them as javascript modules. You will need to register your javascript output by yourself:

  1. // compiled Riot.js component
  2. import MyComponent from './my-component.js'
  3. import {register} from 'riot'
  4. register('my-component', MyComponent)