API

Mako API could be used to build and watch your project programmatically. Use it when you need more flexibility than the CLI provides, or to integrate Mako into your own toolchain.

Build

First, install @umijs/mako:

$ npm i @umijs/mako

Then, use the build function to build your project:

const { build } = require('@umijs/mako');
await build({
  root: process.cwd(),
  watch: false,
  config: {},
});

Options

root

The root directory of the project.

config

Checkout config for more details.

watch

When enabled, Mako will watch for file changes and recompile automatically.

Edit this page on GitHub