Mahalo Transpiler

raw JSON →
0.6.1 verified Fri May 01 auth: no javascript maintenance

A TypeScript-based transpiler for Mahalo applications (v0.6.1). Provides module transpilation with source map generation. Primarily used in development workflows for compiling Mahalo-specific syntax. Alternative to custom build tooling for Mahalo projects. Low release cadence (last update >2 years ago). Requires TypeScript and Node.js.

error Cannot find module 'mahalo-transpiler'
cause Package not installed or not in node_modules.
fix
Run npm install --save-dev mahalo-transpiler.
error TypeError: mahaloTranspiler is not a function
cause Using default import instead of namespace import (see ReadMe).
fix
Use import * as mahaloTranspiler from 'mahalo-transpiler'.
error SyntaxError: Unexpected token 'export'
cause Using require() on an ESM-only package.
fix
Switch to import syntax or configure bundler to handle ESM.
breaking Package no longer supports CommonJS require() starting from v0.6.0.
fix Use ES module import syntax or upgrade to a bundler that can handle ESM.
deprecated The function signature changed in v0.5.0: now returns an object with 'text' and 'map' fields instead of a string.
fix Update code to access result.text and result.map.
gotcha TypeScript declaration files not bundled; may need to install @types/mahalo-transpiler separately.
fix Run npm install --save-dev @types/mahalo-transpiler.
gotcha Transpiler expects input file paths relative to current working directory; absolute paths may fail.
fix Use relative paths or path.resolve with process.cwd().
npm install mahalo-transpiler
yarn add mahalo-transpiler
pnpm add mahalo-transpiler

Transpile a Mahalo module and log the output text.

import * as mahaloTranspiler from 'mahalo-transpiler';

const result: { text: string; map: string } = mahaloTranspiler('./module-name');
console.log(result.text);