Socket
Socket
Sign inDemoInstall

@nx/rollup

Package Overview
Dependencies
Maintainers
5
Versions
612
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nx/rollup

The Nx Plugin for Rollup contains executors and generators that support building applications using Rollup.


Version published
Weekly downloads
116K
increased by1.69%
Maintainers
5
Weekly downloads
 
Created

What is @nx/rollup?

@nx/rollup is a package that integrates Rollup, a module bundler, with the Nx build system. It allows you to bundle JavaScript and TypeScript libraries and applications efficiently within an Nx workspace.

What are @nx/rollup's main functionalities?

Bundling JavaScript/TypeScript Libraries

This feature allows you to bundle JavaScript or TypeScript libraries using Rollup within an Nx workspace. The code sample demonstrates how to configure the build target for a library named 'my-lib' using the @nx/rollup executor.

json
{
  "name": "my-lib",
  "version": "1.0.0",
  "scripts": {
    "build": "nx build my-lib"
  },
  "nx": {
    "targets": {
      "build": {
        "executor": "@nx/rollup:rollup",
        "options": {
          "outputPath": "dist/libs/my-lib",
          "tsConfig": "libs/my-lib/tsconfig.lib.json",
          "project": "libs/my-lib/package.json"
        }
      }
    }
  }
}

Custom Rollup Configuration

This feature allows you to use a custom Rollup configuration file for more advanced bundling scenarios. The code sample shows how to specify a custom Rollup configuration file for an application named 'my-app'.

json
{
  "name": "my-app",
  "version": "1.0.0",
  "scripts": {
    "build": "nx build my-app"
  },
  "nx": {
    "targets": {
      "build": {
        "executor": "@nx/rollup:rollup",
        "options": {
          "outputPath": "dist/apps/my-app",
          "tsConfig": "apps/my-app/tsconfig.app.json",
          "project": "apps/my-app/package.json",
          "rollupConfig": "apps/my-app/rollup.config.js"
        }
      }
    }
  }
}

Watch Mode

This feature enables watch mode for continuous building during development. The code sample demonstrates how to configure the build target for a library named 'my-lib' to run in watch mode.

json
{
  "name": "my-lib",
  "version": "1.0.0",
  "scripts": {
    "build:watch": "nx build my-lib --watch"
  },
  "nx": {
    "targets": {
      "build": {
        "executor": "@nx/rollup:rollup",
        "options": {
          "outputPath": "dist/libs/my-lib",
          "tsConfig": "libs/my-lib/tsconfig.lib.json",
          "project": "libs/my-lib/package.json",
          "watch": true
        }
      }
    }
  }
}

Other packages similar to @nx/rollup

Keywords

FAQs

Package last updated on 26 Sep 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc