@nrwl/web:rollup

Packages a library for different web usages (UMD, ESM, CJS).

Options can be configured in project.json when defining the executor, or when invoking it. Read more about how to configure targets and executors here: https://nx.dev/configuration/projectjson#targets.

Options

assets

Array<oneOf [object , string]>
Default: []

List of static assets.

buildableProjectDepsInPackageJsonType

string
Default: peerDependencies
Accepted values: dependencies, peerDependencies

When updateBuildableProjectDepsInPackageJson is true, this adds dependencies to either peerDependencies or dependencies.

compiler

string
Default: babel
Accepted values: babel, swc

Which compiler to use.

deleteOutputPath

boolean
Default: true

Delete the output path before building.

entryFile

Required
string

The path to the entry file, relative to project.

external

Array<string>

A list of external modules that will not be bundled (react, react-dom, etc.).

extractCss

boolean
Default: true

CSS files will be extracted to the output folder.

format

f
Array<string>
Default: [esm]
Accepted values: esm, umd, cjs

Only build the specified comma-separated formats (esm,umd,cjs)

globals

Default: []

A mapping of node modules to their UMD global names. Used by the UMD bundle.

outputPath

Required
string

The output path of the generated files.

project

Required
string

The path to package.json file.

rollupConfig

oneOf [Array<string>, string]

Path to a function which takes a rollup config and returns an updated rollup config.

tsConfig

Required
string

The path to tsconfig file.

updateBuildableProjectDepsInPackageJson

boolean
Default: true

Update buildable project dependencies in package.json.

umdName

string

The name of your module in UMD format. Defaulted to your project name.

watch

boolean
Default: false

Enable re-building when files change.