1.6 KiB
1.6 KiB
A parcel plugin for riot.js
Using
Add parcel-plugin-riot to your project.
npm i parcel-plugin-riot
-> You are ready!
const riot = require('riot')
require('./src/App.tag')
riot.mount('*')
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
module.exports = {
// html parser
template: 'foo',
// js parser
type: 'baz',
// css parser
style: 'bar',
parsers: {
html: {
foo: (html, opts, url) => require('foo').compile(html)
},
css: {
bar: (tagName, css, opts, url) => require('bar').compile(css)
},
js: {
baz: (js, opts, url) => require('baz').compile(js)
}
},
// special options that may be used to extend
// the default riot parsers options
parserOptions: {
js: {},
template: {},
style: {}
}
}