Skip to content

@nx/rolldown - Generators

The @nx/rolldown plugin provides various generators to help you create and configure rolldown projects within your Nx workspace. Below is a complete reference for all available generators and their options.

For an overview of the plugin and setup instructions, see the @nx/rolldown introduction.

Add Rolldown Configuration to a project.

Usage:

Terminal window
nx generate @nx/rolldown:configuration [options]

Arguments:

Terminal window
nx generate @nx/rolldown:configuration <project> [options]
OptionTypeDescriptionDefault
--externalDependenciesbooleanLeave dependencies from package.json out of the bundle so they load from node_modules at runtime. Defaults to true for the node platform.
--formatstringThe output module format."esm"
--mainstringPath relative to the workspace root for the entry file. Defaults to <projectRoot>/src/main.ts if it exists, otherwise <projectRoot>/src/index.ts.
--outputPathstringPath relative to the workspace root for the output directory. Defaults to <projectRoot>/dist in TypeScript solution workspaces, otherwise dist/<projectRoot>.
--platformstringThe platform to bundle for."node"
--skipFormatbooleanSkip formatting files.false
--skipPackageJsonbooleanDo not add dependencies to package.json.false
--tsConfigstringPath relative to the workspace root for the tsconfig file used to resolve TypeScript options. Defaults to <projectRoot>/tsconfig.app.json or <projectRoot>/tsconfig.lib.json, whichever exists.

You can get help for any generator by adding the --help flag:

Terminal window
nx generate @nx/rolldown:<generator> --help