rollup-plugin-riot
raw JSON → 10.0.0 verified Mon Apr 27 auth: no javascript
Rollup plugin to compile Riot.js tag files during bundling. Current stable version is v10.0.0, requiring @riotjs/compiler >= v10 and Rollup v1+. Release cadence tied to Riot.js major versions: v10 supports Riot 10, v9 supports Riot 9, etc. Drops node <22. Key differentiators: seamless integration of Riot tags into Rollup pipeline, supports custom file extension, include/exclude patterns, and passes through compiler options. Default extension is '.riot'.
Common errors
error Error: Cannot find module '@riotjs/compiler' ↓
cause @riotjs/compiler not installed as a peer dependency.
fix
npm install @riotjs/compiler --save-dev
error TypeError: riot is not a function ↓
cause Using require() on ESM-only version (v7+).
fix
Change to import riot from 'rollup-plugin-riot'
error Error: The plugin 'rollup-plugin-riot' requires Rollup v1.x or above ↓
cause Using an older version of Rollup.
fix
Update Rollup to v1 or higher: npm install rollup@latest --save-dev
Warnings
breaking Version 10.0.0 drops support for Node <22 and requires @riotjs/compiler v10. ↓
fix Update to Node >=22 and install @riotjs/compiler@^10.
breaking Version 6.0.0 updated to Riot.js 6 which is not compatible with Riot.js 5 tag syntax. ↓
fix Use Riot.js 6 compiler and update tag files accordingly.
breaking Version 7.0.0 switched to ESM-only, breaking CommonJS require usage. ↓
fix Use import syntax (ESM) instead of require().
deprecated Versions prior to v4 used riot-compiler as a peer dependency; now @riotjs/compiler is required. ↓
fix Upgrade to v10 and use @riotjs/compiler.
Install
npm install rollup-plugin-riot yarn add rollup-plugin-riot pnpm add rollup-plugin-riot Imports
- riot wrong
const riot = require('rollup-plugin-riot')correctimport riot from 'rollup-plugin-riot'
Quickstart
import riot from 'rollup-plugin-riot';
export default {
input: 'src/main.js',
output: {
file: 'dist/bundle.js',
},
plugins: [
riot({
ext: 'html', // optional: file extension to process
include: ['**/*.riot'], // optional: minimatch pattern
}),
],
};