Skip to content

qlbit-com/rollup-plugin-riot-register

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rollup-plugin-riot-register

Rollup plugin for registering riot.js components.

Compatible with Rollup 3

NPM: https://www.npmjs.com/package/rollup-plugin-riot-register

How it works: it is a plugin for Rollup, to generate code on the fly to register riot.js componets. rollup.config.mjs to provide locations to scan for riot.js components. entry point [./src/index.js] to call generated code to register all found compoents.


Usage:

Install from NPM:

npm install rollup-plugin-riot-register

Configuration:

in your rollup.config.mjs

import rollupRiotRegister from 'rollup-plugin-riot-register'
export default {
  input: './src/index.js',
  plugins: [
    rollupRiotRegister( [ './src/components/global/**/*.riot', './src/components/local/**/*.riot' ] )
  ]
}

in ./src/index.js

import { mount } from 'riot'
import registerComponents from 'riot:components'

// register
registerComponents()

mount('[data-riot-component]')

About

rollup plugin for registering riot.js components

Resources

License

Stars

Watchers

Forks

Packages

No packages published