Skip to content

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

configuration

Add Rollup Configuration to a project.

Usage:

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

Aliases: rollup-project

Arguments:

Terminal window
nx generate @nx/rollup:configuration <project> [options]

Options

OptionTypeDescriptionDefault
--buildTargetstringThe build target to add."build"
--compilerstringThe compiler to use to build source."babel"
--externalarrayA list of external modules that will not be bundled (react, react-dom, etc.).
--formatarrayThe format to build the library (esm or cjs).["esm"]
--importPathstringThe library name used to import it, like @myorg/my-awesome-lib.
--mainstringPath relative to the workspace root for the main entry file. Defaults to ‘/src/index.ts’.
--rollupConfigstringPath relative to workspace root to a custom rollup file that takes a config object and returns an updated config.
--skipFormatbooleanSkip formatting files.false
--skipPackageJsonbooleanDo not add dependencies to package.json.false
--skipValidationbooleanDo not perform any validation on existing project.false
--tsConfigstringPath relative to the workspace root for the tsconfig file to build with. Defaults to ‘/tsconfig.lib.json’.

convert-to-inferred

Convert existing Rollup project(s) using @nx/rollup:rollup executor to use @nx/rollup/plugin. Defaults to migrating all projects. Pass ‘—project’ to migrate only one target.

Usage:

Terminal window
nx generate @nx/rollup:convert-to-inferred [options]

Options

OptionTypeDescriptionDefault
--projectstringThe project to convert from using the @nx/rollup:rollup executor to use @nx/rollup/plugin.
--skipFormatbooleanWhether to format files at the end of the migration.false

Getting Help

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

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