Rollup Plugin
The Rollup plugin provides JSX transformation for HellaJS with fine-grained bundling control.
Installation
Section titled “Installation”npm install --save-dev rollup-plugin-hellajs
Basic Configuration
Section titled “Basic Configuration”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() ]};
Production Build
Section titled “Production Build”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() ]};
TypeScript Support
Section titled “TypeScript Support”For TypeScript projects, ensure your tsconfig.json
includes:
{ "compilerOptions": { "jsx": "preserve", "types": [ "@hellajs/dom" ], }}