2019-05-14 22:14:59 +02:00

59 lines
1.7 KiB
Markdown

[![Build Status][travis-image]][travis-url]
[![NPM version][npm-version-image]][npm-url]
[![NPM downloads][npm-downloads-image]][npm-url]
[![MIT License][license-image]][license-url]
A parcel plugin for riot.js
## Important
If you are using Riot.js < 4.0.0 please check the [v3 branch](https://github.com/riot/parcel-plugin-riot/tree/v3)
## Using
Add parcel-plugin-riot to your project.
```bash
npm i -D @riotjs/parcel-plugin-riot @riotjs/compiler
```
-> You are ready!
```js
import App from './src/App.riot'
import {component} from 'riot'
component(App)(document.querySelector('#root'), {
message: 'Hello there'
})
```
## Configuration
If you want compile your tags using custom riot compiler options you can create a `riot.config.js` in the root folder of your project
```js
module.exports = {
hot: false // set it to true if you are using hmr
// add here all the other @riotjs/compiler options riot.js.org/compiler
// template: 'pug' for example
}
```
If you want to enable hmr via `hot` option you will need to install also [`@riotjs/hot-reload`](https://www.npmjs.com/package/@riotjs/hot-reload)
```bash
npm i @riotjs/hot-reload -D
```
[travis-image]: https://img.shields.io/travis/riot/parcel-plugin-riot.svg?style=flat-square
[travis-url]: https://travis-ci.org/riot/parcel-plugin-riot
[license-image]: https://img.shields.io/badge/license-MIT-000000.svg?style=flat-square
[license-url]: LICENSE
[npm-version-image]: https://img.shields.io/npm/v/parcel-plugin-riot.svg?style=flat-square
[npm-downloads-image]: https://img.shields.io/npm/dm/parcel-plugin-riot.svg?style=flat-square
[npm-url]: https://npmjs.org/package/parcel-plugin-riot