@nrwl/rollup:rollup

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

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/reference/project-configuration#targets.

Options

main

entryFileRequired
string

The path to the entry file, relative to project.

outputPath

Required
string

The output path of the generated files.

project

Required
string

The path to package.json file.

tsConfig

Required
string

The path to tsconfig file.

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, tsc

Which compiler to use.

deleteOutputPath

boolean
Default: true

Delete the output path before building.

external

Array<string>

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

extractCss

boolean ∪ string
Default: true

CSS files will be extracted to the output folder. Alternatively custom filename can be provided (e.g. styles.css)

format

f
Array<string>
Accepted values: esm, cjs

List of module formats to output. Defaults to matching format from tsconfig (e.g. CJS for CommonJS, and ESM otherwise).

generateExportsField

boolean
Default: false

Generate package.json with 'exports' field. This field defines entry points in the package and is used by Node and the TypeScript compiler.

javascriptEnabled

boolean
Default: false

Sets javascriptEnabled option for less loader

outputFileName

string

Name of the main output file. Defaults same basename as 'main' file.

rollupConfig

oneOf [Array<string>, string]

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

skipTypeField

boolean
Default: false

Prevents 'type' field from being added to compiled package.json file. Only use this if you are having an issue with this field.

updateBuildableProjectDepsInPackageJson

boolean
Default: true

Update buildable project dependencies in package.json.

watch

boolean
Default: false

Enable re-building when files change.