compileType configuration option tells MorJS what kind of artifact to produce. Each type uses a different root entry file and generates a different output structure.
Available types
miniprogram.
miniprogram
A complete standalone mini-program application. The root entry file isapp.json.
app.json declares the page list, window defaults, and tab bar. MorJS reads it to discover all pages and components that need to be compiled.
plugin
A mini-program plugin that extends a host mini-program. The root entry file isplugin.json.
App() lifecycle, MorJS uses a mock app entry to provide the initialization context that runtime injection requires. By default it looks for mor.plugin.app and falls back to app.
subpackage
A standalone subpackage intended to be integrated into a host mini-program. The root entry file issubpackage.json.
processPlaceholderComponents is false for subpackages. The mock app entry precedence is mor.subpackage.app then app.
component
A single standalone component intended to be published as a library. There is no fixed entry file name — the entry is a single component directory.Entry file reference
| Compile type | Root entry file | Chinese description |
|---|---|---|
miniprogram | app.json | 小程序 |
plugin | plugin.json | 插件 |
subpackage | subpackage.json | 分包 |
component | (component dir) | 组件 |
mockAppEntry
Forplugin and subpackage compile types there is no App() in source, but the runtime needs an app context to initialize. The mockAppEntry option points to an alternative app entry file:
Use type-specific default
For
plugin type, mor.plugin.app is tried first. For subpackage type, mor.subpackage.app is tried first.processPlaceholderComponents
This option controls whethercomponentPlaceholder entries in app.json are compiled:
| Compile type | Default value |
|---|---|
miniprogram | true |
plugin | true |
subpackage | false |
component | false |