rollup-plugin-riot-register

1.0.1 • Public • Published

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]')

/rollup-plugin-riot-register/

    Package Sidebar

    Install

    npm i rollup-plugin-riot-register

    Weekly Downloads

    1

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    5.25 kB

    Total Files

    5

    Last publish

    Collaborators

    • dpichugin