MT WXML Transpiler

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

A forked version of wxml-transpiler (v0.0.4) that converts WXML (WeChat Mini Program template language) into standard HTML/JSX or other formats. It is in early development with no clear release cadence. Differentiators: maintained fork of an otherwise stale upstream. Currently limited documentation; suitable for developers needing WXML transformation in Node.js with a simple spawn/exec interface.

error TypeError: Cannot read properties of undefined (reading 'replace')
cause Calling transpile without providing a string input.
fix
Ensure you pass a string: transpile('...')
error Error: Unsupported format: jsx
cause Format option not supported. Only 'html' or 'wxml' are valid.
fix
Use format: 'html' or omit for default.
gotcha Package is a fork with minimal changes; rely on original wxml-transpiler docs at your own risk.
fix Refer to wxml-transpiler documentation for API details, but verify behavior with this package.
deprecated No official support for WeChat Mini Program latest syntax (e.g., custom components, WXS).
fix Consider using other tools like wepy or taro for full-featured conversion.
gotcha The package uses CommonJS internally but expects ESM import; CJS require fails silently.
fix Use `import` syntax as shown in imports.
npm install mt-wxml-transpiler
yarn add mt-wxml-transpiler
pnpm add mt-wxml-transpiler

Transpile a simple WXML string to HTML using the `transpile` function with format option.

import { transpile } from 'mt-wxml-transpiler';

const inputWxml = `<view>Hello</view>`;
const output = transpile(inputWxml, {
  format: 'html'
});
console.log(output); // <div>Hello</div>