Learn Nuxt with a Collection of 100+ Tips!

nuxi build-module

Nuxt command to build your Nuxt module before publishing.
Terminal
npx nuxi build-module [ROOTDIR] [--cwd=<directory>] [--logLevel=<silent|info|verbose>] [--build] [--stub] [--sourcemap] [--prepare]

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

ArgumentDescription
ROOTDIR="."Specifies the working directory (default: .)

Options

OptionDefaultDescription
--cwd=<directory>Specify the working directory, this takes precedence over ROOTDIR (default: .)
--logLevel=<silent|info|verbose>Specify build-time log level
--buildfalseBuild module for distribution
--stubfalseStub dist instead of actually building it for development
--sourcemapfalseGenerate sourcemaps
--preparefalsePrepare module for local development
Read more about @nuxt/module-builder.