smalljs$molSearch⌘ KDocsPlaygroundCompareEcosystemAboutEN
InstallationGetting StartedIntroductionMental modelGetting StartedFrom TypeScript to view.treeProject StructureToolingEssentialsInstallationViewsState & ReactivityRoutingRenderingTestingDeploymentTroubleshootingDataData FetchingData SchemasGiper BazaMoreShowcaseFrom React, Vue & SvelteCookbookAdvancedPluginsModule metadataOfflineGhost viewsAboutFAQTeamReleasesAPI$mol_button_major$mol_button_minor$mol_string$mol_number$mol_text$mol_paragraph$mol_list$mol_row$mol_link$mol_check$mol_switch$mol_select$mol_scroll$mol_page$mol_pick

Installation

Getting Started walks you through your first app step by step. This page is the reference: how a $mol project is laid out and how the build works.

Requirements

Node.js 18+ and git. Nothing else is installed globally.

The MAM workspace

$mol apps live inside MAM — the build tool and module registry. You clone it once and develop your modules inside it:1git clone https://github.com/hyoo-ru/mam.git ./mam2cd mam3npm install4npm startnpm start runs a watching dev server on http://localhost:9080/. It rebuilds on save and resolves dependencies automatically — you never maintain a bundler config.

How modules are named

Every component name maps to a folder path, and each underscore is a folder separator:1$my_appmy/app/2$my_app_headermy/app/header/Module folder names never contain an underscore — use nested folders for multi-word names. If a component you use never shows up in the bundle, the folder path almost always doesn't match the class name.

Anatomy of a module

A component is a folder with up to four files:FilePurposename.view.treeDeclarative layoutname.view.tsBehaviour (TypeScript)name.view.css.tsTyped stylesname.view.tree, index.htmlEntry point for an app moduleThe index.html of an app mounts the root component:1<body mol_view_root>2 <div mol_view_root="$my_app"></div>3 <script src="web.js"></script>4</body>

Building for production

The dev server builds on the fly, but you can build any module explicitly from the workspace root:1npm run start my/appThe output lands in my/app/-/ — including web.js, web.css, and web.audit.js. Always check the audit: a clean web.audit.js means no unused dependencies and no type errors.

Adding npm packages

Reference a package with require and MAM installs it on the next build:1const dayjs = require( 'dayjs' ) as typeof import( 'dayjs' )

Next

With the workspace in place, learn how the UI itself is described — continue to Views.
Edit this page on GitHubWas this helpful?YesNoPreviousToolingNextViews
On this pageRequirementsThe MAM workspaceHow modules are namedAnatomy of a moduleBuilding for productionAdding npm packagesNext
Type to search the documentation.