2023-10-18 10:59:43 +00:00
---
title: 'nuxi build-module'
description: 'Nuxt command to build your Nuxt module before publishing.'
links:
- label: Source
icon: i-simple-icons-github
to: https://github.com/nuxt/cli/blob/main/src/commands/build-module.ts
size: xs
---
2022-10-16 09:40:03 +00:00
2024-12-18 10:29:56 +00:00
<!-- build - module - cmd -->
2023-10-18 10:59:43 +00:00
```bash [Terminal]
2024-12-18 10:29:56 +00:00
npx nuxi build-module [ROOTDIR] [--cwd=< directory > ] [--logLevel=< silent | info | verbose > ] [--build] [--stub] [--sourcemap] [--prepare]
2022-10-16 09:40:03 +00:00
```
2024-12-18 10:29:56 +00:00
<!-- /build - module - cmd -->
2022-10-16 09:40:03 +00:00
The `build-module` command runs `@nuxt/module-builder` to generate `dist` directory within your `rootDir` that contains the full build for your **nuxt-module** .
2024-12-18 10:29:56 +00:00
## Arguments
2022-10-16 09:40:03 +00:00
2024-12-18 10:29:56 +00:00
<!-- build - module - args -->
Argument | Description
--- | ---
`ROOTDIR="."` | Specifies the working directory (default: `.` )
<!-- /build - module - args -->
## Options
<!-- build - module - opts -->
Option | Default | Description
--- | --- | ---
`--cwd=<directory>` | | Specify the working directory, this takes precedence over ROOTDIR (default: `.` )
`--logLevel=<silent\|info\|verbose>` | | Specify build-time log level
`--build` | `false` | Build module for distribution
`--stub` | `false` | Stub dist instead of actually building it for development
`--sourcemap` | `false` | Generate sourcemaps
`--prepare` | `false` | Prepare module for local development
<!-- /build - module - opts -->
::read-more{to="https://github.com/nuxt/module-builder" icon="i-simple-icons-github" color="gray" target="\_blank"}
2023-10-18 10:59:43 +00:00
Read more about `@nuxt/module-builder` .
2022-10-16 09:40:03 +00:00
::