Skip to main content

What is MorJS?

MorJS (pronounced /mɔːr/, like “more”) is a cross-platform mini-program development framework developed by Ele.me. It is built on top of standard mini-program DSL — you write your app once using either WeChat or Alipay mini-program syntax, and MorJS compiles that source into native output for each supported platform. MorJS covers every phase from source to build artifact through a full-lifecycle plugin system, supporting everything from basic pages and components to complex subpackages and plugins.

Key advantages

Ease of use

Use the mini-program DSL you already know — WeChat or Alipay — with no extra framework to learn. Add two packages and one config file to an existing project.

Standardization

Scaffolding, compilation, analysis, and multi-platform output ship out of the box in a single dependency. Compile-time and runtime normalization delivers consistent behavior across platforms.

Flexibility

Every internal capability is a plugin. Add enforce: 'pre' or enforce: 'post' to control execution order. Support for TypeScript, Less, SCSS, JSONC, and JSON5 is built in.

Supported platforms

MorJS compiles your source to any of the following targets by passing --target to the CLI:
TargetPlatformNotes
wechatWeChat微信小程序
alipayAlipay支付宝小程序
baiduBaidu百度智能小程序
bytedanceByteDance字节跳动小程序 (Douyin)
qqQQQQ 小程序
kuaishouKuaishou快手小程序
taobaoTaobao淘宝小程序
dingdingDingTalk钉钉小程序
webWebH5 Web application

Core packages

MorJS is a monorepo. The packages you interact with most directly are:

@morjs/cli

The command-line entry point. Registers mor compile, mor create, mor compose, and other commands. Exposes defineConfig for typed config files. Sets mor.config.* as the config file name.

@morjs/core

Runtime helpers for apps, pages, and components. Exports createApp, createPage, createComponent, and adapters (wApp/aApp, wPage/aPage, wComponent/aComponent) that normalize behavior across platforms.

@morjs/plugin-compiler

The compilation engine. Orchestrates webpack, platform-specific loaders (script, template, style, config, sjs), entry discovery, and the transform/bundle pipeline.

@morjs/runtime-mini

Platform runtime shims for Alipay, Baidu, ByteDance, Kuaishou, QQ, and WeChat. Normalizes lifecycle and API differences at runtime so cross-platform code behaves consistently.

@morjs/runtime-web

Bridges mini-program APIs to the browser environment so compiled output can run as an H5 application.

@morjs/takin

The underlying CLI engine. Provides the Takin class, Runner, plugin system, config loading, and tapable lifecycle hooks used by all MorJS packages.
The @morjs/utils package re-exports @morjs/takin together with webpack utilities, zod schema helpers, and shared constants. @morjs/cli imports from @morjs/utils rather than @morjs/takin directly.

Project forms

MorJS supports three mini-program project forms and allows converting between them:
  • Mini-program — a full standalone mini-program
  • Subpackage — a lazy-loaded subpackage inside a larger mini-program
  • Plugin — a mini-program plugin distributed as a reusable unit

Next steps

Getting started

Install the CLI, scaffold a project, and run your first compile.

Architecture

Understand Takin, Runner, and the plugin lifecycle.

Compile targets

Configure which platforms to compile to and how.

Plugin development

Write your own plugin to extend the MorJS lifecycle.

Build docs developers (and LLMs) love