Skip to main content

Requirements

MorJS requires Node.js >= 12.13.0. You can check your current version with:
node --version

Install the CLI

Install @morjs/cli globally to get the mor command available system-wide.
npm install -g @morjs/cli

Verify installation

mor --version
You should see the installed version of @morjs/cli printed to the terminal.

Adding MorJS to an existing project

If you already have a mini-program project, add the CLI and compiler as development dependencies:
npm install --save-dev @morjs/cli @morjs/plugin-compiler
Then invoke the CLI through your package.json scripts using mor directly:
package.json
{
  "scripts": {
    "dev": "mor compile -w",
    "build": "mor compile"
  }
}

Adding runtime support

For cross-platform runtime APIs (App, Page, Component lifecycle bridging), add @morjs/core:
npm install @morjs/core
@morjs/core is a runtime dependency, not a dev dependency. It is required at runtime when autoInjectRuntime is enabled (the default for cross-platform compilation).

Next steps

Project Setup

Scaffold a new project and understand the directory structure.

Configuration

Learn how to configure mor.config.ts for your project.

Build docs developers (and LLMs) love