A compiler plugin for the morjs CLI that adds support for building miniprograms targeting the Xiaohongshu platform. Current version 0.0.27, released as a companion plugin to the morjs multi-platform miniprogram framework. Enables developers to write or convert miniprogram code (e.g., from wx) to the Xiaohongshu (小红书) runtime by integrating with morjs's plugin system. Key differentiator: official morjs plugin set for Xiaohongshu output, built on top of morjs's generic compilation pipeline. Requires @morjs/cli and manual registration via setCompilerPlugins. Ships TypeScript types.
npm install morjs-plugin-compiler-xhsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to register the XHS compiler plugin with morjs using ESM imports and the plugin registration API.
Replace `import PluginXHS from 'morjs-plugin-compiler-xhs'` with `import * as PluginXHS from 'morjs-plugin-compiler-xhs'` or use `const PluginXHS = require('morjs-plugin-compiler-xhs')`.Always call `getAllCompilerPlugins()` and spread its result when calling `setCompilerPlugins`.
Enable `esModuleInterop` in tsconfig.json or use `import * as` syntax to avoid type errors.
Pin exact version and test thoroughly after updates.
Use `import { createRequire } from 'module'; const require = createRequire(import.meta.url); const pkg = require('morjs-plugin-compiler-xhs/package.json')` or just avoid reading package.json.Run `npm install morjs-plugin-compiler-xhs` in the project root.
Use `import { setCompilerPlugins } from '@morjs/cli'` (named import).