Eustia Component Transpiler

raw JSON →
0.0.3 verified Fri May 01 auth: no javascript

A transpiler plugin for the Eustia build tool that converts HTML files containing inline styles, templates, and scripts into pure JavaScript modules. Version 0.0.3 is the latest release. It is designed for use with Eustia to simplify authoring reusable UI components with HTML and CSS, without relying on web components. The transpiler extracts CSS into a string variable, HTML templates into string variables, and concatenates script content, providing a simple component pattern for library authors.

error Error: Cannot find module 'eustia-component'
cause Package not installed or missing in node_modules.
fix
Run 'npm install eustia-component'
error TypeError: handler is not a function
cause Using require('eustia-component') instead of require('eustia-component')().
fix
Change handler: require('eustia-component') to handler: require('eustia-component')()
deprecated Package is very low version and rarely updated; may not be maintained for future Eustia versions.
fix Consider using modern component frameworks like Vue or React if Eustia support is discontinued.
gotcha The exported function must be called with no arguments to get the transpiler handler; directly using require('eustia-component') as handler will fail.
fix Use handler: require('eustia-component')()
gotcha The plugin only works within the Eustia build system; it is not a standalone HTML-to-JS converter.
fix Ensure Eustia is properly configured in your project.
npm install eustia-component
yarn add eustia-component
pnpm add eustia-component

Shows how to configure Eustia to use eustia-component as a transpiler for .html files.

// eustia.config.js
module.exports = {
    util: {
        files: 'index.html',
        extension: ['js', 'html'],
        transpiler: [
            {
                test: /\.html$/,
                handler: require('eustia-component')()
            }
        ]
    }
};