From 285d304d668a5b219b099e98e939f6a09f83b501 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Thu, 12 Nov 2026 19:38:05 +0000 Subject: [PATCH 1/3] docs: document build-module subcommands and link module-builder docs --- docs/build-module.md | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/docs/build-module.md b/docs/build-module.md index 23e394810..af8b347ad 100644 --- a/docs/build-module.md +++ b/docs/build-module.md @@ -10,7 +10,8 @@ links: ```bash [Terminal] -npx nuxt build-module [ROOTDIR] [--cwd=] [--logLevel=] [--build] [--stub] [--sourcemap] [--prepare] +npx nuxt build-module build [ROOTDIR] [--cwd=] [--outDir=] [--sourcemap] [--stub] +npx nuxt build-module prepare [ROOTDIR] [--cwd=] ``` @@ -27,16 +28,26 @@ The `build-module` command runs `@nuxt/module-builder` to generate `dist` direct ## Options -| Option | Default | Description | -|--------------------------------------|---------|----------------------------------------------------------------------------------| -| `--cwd=` | | Specify the working directory, this takes precedence over ROOTDIR (default: `.`) | -| `--logLevel=` | | 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` + +| Option | Default | Description | +|------------------------|---------|----------------------------------------------------------------------------------| +| `--cwd=` | | Specify the working directory, this takes precedence over ROOTDIR (default: `.`) | +| `--outDir=` | `dist` | Build directory | +| `--sourcemap` | `false` | Generate sourcemaps | +| `--stub` | `false` | Stub dist instead of actually building it for development | + +### `prepare` + +| Option | Default | Description | +|---------------------|---------|----------------------------------------------------------------------------------| +| `--cwd=` | | Specify the working directory, this takes precedence over ROOTDIR (default: `.`) | -::read-more{to="https://github.com/nuxt/module-builder" icon="i-simple-icons-github" target="\_blank"} +`--stub` skips the full build and writes a `dist` directory whose files re-export your module's source, so a consuming project sees changes without a rebuild. Read more about [stub builds](/docs/guide/modules/module-builder/commands#build-stub). + +Run `nuxt build-module prepare` to generate the `.nuxt` directory and module types you need while developing the module. Read more about [preparing a module](/docs/guide/modules/module-builder/commands#prepare). + +::read-more{to="/docs/guide/modules/module-builder"} Read more about `@nuxt/module-builder`. :: From 645834bccdf588bd0e66974fc4ee68a1acadc9b8 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Fri, 13 Nov 2026 00:34:17 +0000 Subject: [PATCH 2/3] docs: more tweaks --- docs/build-module.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/build-module.md b/docs/build-module.md index af8b347ad..9fb405866 100644 --- a/docs/build-module.md +++ b/docs/build-module.md @@ -30,12 +30,12 @@ The `build-module` command runs `@nuxt/module-builder` to generate `dist` direct ### `build` -| Option | Default | Description | -|------------------------|---------|----------------------------------------------------------------------------------| -| `--cwd=` | | Specify the working directory, this takes precedence over ROOTDIR (default: `.`) | -| `--outDir=` | `dist` | Build directory | -| `--sourcemap` | `false` | Generate sourcemaps | -| `--stub` | `false` | Stub dist instead of actually building it for development | +| Option | Default | Description | +|------------------------|---------|-------------------------------------------------------------------------------------------------| +| `--cwd=` | | Specify the working directory, this takes precedence over ROOTDIR (default: `.`) | +| `--outDir=` | `dist` | Build directory. The build empties it first, so do not use a directory that holds source files. | +| `--sourcemap` | `false` | Generate sourcemaps | +| `--stub` | `false` | Stub dist instead of actually building it for development | ### `prepare` @@ -44,7 +44,7 @@ The `build-module` command runs `@nuxt/module-builder` to generate `dist` direct | `--cwd=` | | Specify the working directory, this takes precedence over ROOTDIR (default: `.`) | -`--stub` skips the full build and writes a `dist` directory whose files re-export your module's source, so a consuming project sees changes without a rebuild. Read more about [stub builds](/docs/guide/modules/module-builder/commands#build-stub). +`--stub` skips the full build and writes a `dist` directory whose files re-export your module's source, so a consuming project sees changes without a rebuild. It does not populate `dist/runtime`, so subpath exports that point there need a full build. Read more about [stub builds](/docs/guide/modules/module-builder/commands#build-stub). Run `nuxt build-module prepare` to generate the `.nuxt` directory and module types you need while developing the module. Read more about [preparing a module](/docs/guide/modules/module-builder/commands#prepare). From b620b28eb017bbfc259e880645dd25b9a4824a30 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Fri, 13 Nov 2026 07:52:54 +0000 Subject: [PATCH 3/3] docs: remove build-module page, served from module-builder --- docs/build-module.md | 53 -------------------------------- scripts/generate-command-docs.ts | 2 +- 2 files changed, 1 insertion(+), 54 deletions(-) delete mode 100644 docs/build-module.md diff --git a/docs/build-module.md b/docs/build-module.md deleted file mode 100644 index 9fb405866..000000000 --- a/docs/build-module.md +++ /dev/null @@ -1,53 +0,0 @@ ---- -title: 'nuxt 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/module-builder/blob/main/src/cli.ts - size: xs ---- - - -```bash [Terminal] -npx nuxt build-module build [ROOTDIR] [--cwd=] [--outDir=] [--sourcemap] [--stub] -npx nuxt build-module prepare [ROOTDIR] [--cwd=] -``` - - -The `build-module` command runs `@nuxt/module-builder` to generate `dist` directory within your `rootDir` that contains the full build for your **nuxt-module**. - -## Arguments - - -| Argument | Description | -|---------------|------------------------------------------------| -| `ROOTDIR="."` | Specifies the working directory (default: `.`) | - - -## Options - - -### `build` - -| Option | Default | Description | -|------------------------|---------|-------------------------------------------------------------------------------------------------| -| `--cwd=` | | Specify the working directory, this takes precedence over ROOTDIR (default: `.`) | -| `--outDir=` | `dist` | Build directory. The build empties it first, so do not use a directory that holds source files. | -| `--sourcemap` | `false` | Generate sourcemaps | -| `--stub` | `false` | Stub dist instead of actually building it for development | - -### `prepare` - -| Option | Default | Description | -|---------------------|---------|----------------------------------------------------------------------------------| -| `--cwd=` | | Specify the working directory, this takes precedence over ROOTDIR (default: `.`) | - - -`--stub` skips the full build and writes a `dist` directory whose files re-export your module's source, so a consuming project sees changes without a rebuild. It does not populate `dist/runtime`, so subpath exports that point there need a full build. Read more about [stub builds](/docs/guide/modules/module-builder/commands#build-stub). - -Run `nuxt build-module prepare` to generate the `.nuxt` directory and module types you need while developing the module. Read more about [preparing a module](/docs/guide/modules/module-builder/commands#prepare). - -::read-more{to="/docs/guide/modules/module-builder"} -Read more about `@nuxt/module-builder`. -:: diff --git a/scripts/generate-command-docs.ts b/scripts/generate-command-docs.ts index 4447a3e72..a8e10ee45 100644 --- a/scripts/generate-command-docs.ts +++ b/scripts/generate-command-docs.ts @@ -61,7 +61,7 @@ interface DocEntry { * * `build-module.md` is absent: `nuxt build-module` is not a registered command, * it resolves the `@nuxt/module-builder` binary through the `nuxt-` - * fallback, so its flags are declared in another repository. + * fallback, and that repository now owns the command page. */ const DOCS: DocEntry[] = [ { id: 'add', file: 'add.md', command: ['add'] },