{"id":25915,"library":"mahal-html-compiler","title":"mahal-html-compiler","description":"Official HTML compiler for the Mahal framework (v1.4.1). Transforms Mahal-specific HTML templates into render functions, supporting directives, expressions, and component nesting. Designed exclusively for Mahal's reactive UI system, it is tightly coupled to the framework and not intended for standalone use. Releases are less frequent, tied to Mahal updates. Ships TypeScript types.","status":"active","version":"1.4.1","language":"javascript","source_language":"en","source_url":"https://github.com/ujjwalguptaofficial/mahal-html-compiler","tags":["javascript","mahal","compiler","html","ui","framework","typescript"],"install":[{"cmd":"npm install mahal-html-compiler","lang":"bash","label":"npm"},{"cmd":"yarn add mahal-html-compiler","lang":"bash","label":"yarn"},{"cmd":"pnpm add mahal-html-compiler","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM-only; CommonJS require will fail in Node.js ESM context","wrong":"const compile = require('mahal-html-compiler').compile","symbol":"compile","correct":"import { compile } from 'mahal-html-compiler'"},{"note":"Named export, not default","wrong":"import MahalHTMLCompiler from 'mahal-html-compiler'","symbol":"MahalHTMLCompiler","correct":"import { MahalHTMLCompiler } from 'mahal-html-compiler'"},{"note":"TypeScript users should use `import type` for type-only imports","wrong":"","symbol":"CompileOptions","correct":"import type { CompileOptions } from 'mahal-html-compiler'"}],"quickstart":{"code":"import { compile } from 'mahal-html-compiler';\n\nconst template = '<div>{{ message }}</div>';\nconst options = { filename: 'App.mahal' };\nconst result = compile(template, options);\nconsole.log(result.code);","lang":"typescript","description":"Compiles a simple Mahal template with an interpolation expression."},"warnings":[{"fix":"Ensure your project uses Mahal >=1.0.0.","message":"Requires Mahal framework >=1.0.0; not backward compatible with older Mahal versions.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Precompile templates during build step using Mahal CLI or bundler plugin.","message":"Does not support runtime compilation in browser; templates must be precompiled.","severity":"gotcha","affected_versions":"all"},{"fix":"Validate templates manually before compilation.","message":"Errors in template syntax produce cryptic parse errors; no line-level error mapping.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use ES module import syntax.","cause":"Using require() instead of import.","error":"Cannot find module 'mahal-html-compiler' require() of ES Module"},{"fix":"Use `import { compile } from 'mahal-html-compiler'`","cause":"Incorrect import: default import instead of named import.","error":"TypeError: compile is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}