Skip to content

Latest commit

 

History

History
 
 

rollup

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Riot with Rollup

This is a simple example to show how to use Riot with Rollup.

Run locally

Download or clone this repo:

$ git clone https://github.com/riot/examples
$ cd examples/rollup

Then run these commands:

$ npm install
$ npm run build

dist directory will be made in your project.

ES6 and cssnext

The code in this example is written in ES6 syntax. Rollup is an module bundler for ES6. Typically, we use these plugins. See detail:

  • rollup-plugin-commonjs: converts CommonJS to ES6
  • rollup-plugin-node-resolve: finds modules in node_modules
  • rollup-plugin-riot: compiles Riot tag files

Use imported modules

In this example, marked is used for transforming markdown into html.

<md>
  <script>
    import marked from 'marked'

    // do something with marked
  </script>
</md>

Watch

To watch your tag file and check it in your browser, run the command below:

$ npm start

See more detail: