---
title: build
---

# `build`

Generate code ready for production deployment.

## Tuya MiniApp IDE automate build execution

Tuya MiniApp IDE can be configured to automatically execute build when packaging, eliminating the need to manually execute 'ray build' from the console. Configure `devMode: ray` in `project.tuya.json` to associate `ray build` when uploading a project.

```json
{
  "devMode": "ray"
}
```

## Command description

`ray build ./my-app`

> **Note**: `my-app` indicates the directory where the project is located.

```bash
Usage: ray-build [options] [cwd]

Run the command to build an application or component.

Options:
  --source <folder>        The directory of source code. Default value: src.
  --output <folder>        The output directory.
  --mini                   Enable the compression of the output files. Default value: true.
  --no-mini                Disable the compression of the output files.
  -t --target <target>     The target platform.
  -a --analyze             Enable analyze. Default value: false.
  --type <type>            The build type. Valid values: app and component. Default value: app.
  --transform-mode <mode>  The conversion type of a component. Valid values: auto and pure. Default value: auto.
  -h, --help               Display help for this command.
```

## Options

### source

The source code directory of the project. Default value: `src`.

### output

The output directory.

### mini

After `mini` is enabled, the generated files are compressed to a certain extent, and a certain amount of compilation time is consumed. Due to limitations by the Tuya MiniApp IDE, the files can meet the upload requirements after compression is enabled. By default, `mini` is enabled in `build` mode.

> **Important**:
> Compression in `dev` mode is not equivalent to that in `build` mode, and the actual application size depends on the `build` result.

### no-mini

Disable the compression of the output files.

### target

The target platform. Valid values: `web`, `wechat`, `tuya`, `ios`, and `android`.

### analyze

Enable the visualized analytics method `analyze`. For more information, see [Webpack Bundle Analyzer](https://www.npmjs.com/package/webpack-bundle-analyzer).

### type

The build type. Valid values: `app` and `component`.

## transform-mode

The conversion type of a component. It is valid only when the `type` is `component`. Valid values: `auto` and `pure`.
