Skip to content

Rollup Plugin

The Rollup plugin provides JSX transformation for HellaJS with fine-grained bundling control.

Terminal window
npm install --save-dev rollup-plugin-hellajs

Add the plugin to your rollup.config.js:

import rollupHellaJS from 'rollup-plugin-hellajs';
export default {
input: 'src/main.jsx',
output: {
file: 'dist/bundle.js',
format: 'es'
},
plugins: [
rollupHellaJS()
]
};

For production with minification:

import rollupHellaJS from 'rollup-plugin-hellajs';
import resolve from '@rollup/plugin-node-resolve';
import terser from '@rollup/plugin-terser';
export default {
input: 'src/main.jsx',
output: {
file: 'dist/bundle.min.js',
format: 'iife'
},
plugins: [
rollupHellaJS(),
resolve(),
terser()
]
};

For TypeScript projects, ensure your tsconfig.json includes:

{
"compilerOptions": {
"jsx": "preserve",
"types": [
"@hellajs/dom"
],
}
}