This is a simple example to show how to use Riot with Rollup.
- Site: https://rollupjs.org
- Docs: https://github.com/rollup/rollup/wiki
- rollup-plugin-riot: https://github.com/riot/rollup-plugin-riot
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.
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 ES6rollup-plugin-node-resolve
: finds modules innode_modules
rollup-plugin-riot
: compiles Riot tag files
In this example, marked is used for transforming markdown into html.
<md>
<script>
import marked from 'marked'
// do something with marked
</script>
</md>
To watch your tag file and check it in your browser, run the command below:
$ npm start
See more detail: