Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@nrwl/rollup

Package Overview
Dependencies
Maintainers
0
Versions
818
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nrwl/rollup

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

  • 19.8.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created

What is @nrwl/rollup?

@nrwl/rollup is a package that provides support for building and bundling JavaScript and TypeScript libraries using Rollup within the Nx workspace. It simplifies the configuration and integration of Rollup in Nx projects, allowing developers to efficiently bundle their code.

What are @nrwl/rollup's main functionalities?

Library Bundling

This feature allows you to bundle a TypeScript library into a single JavaScript file using Rollup. The configuration specifies the input file, output file, and format, along with necessary plugins for resolving modules, handling commonjs, and compiling TypeScript.

module.exports = {
  input: 'src/index.ts',
  output: {
    file: 'dist/bundle.js',
    format: 'cjs'
  },
  plugins: [
    require('@rollup/plugin-node-resolve').nodeResolve(),
    require('@rollup/plugin-commonjs')(),
    require('@rollup/plugin-typescript')()
  ]
};

Nx Integration

This feature demonstrates how to use the createRollupConfig function provided by @nrwl/rollup to generate a Rollup configuration that is integrated with Nx. This simplifies the setup process and ensures compatibility with Nx workspace conventions.

const { createRollupConfig } = require('@nrwl/rollup');

module.exports = createRollupConfig({
  input: 'src/index.ts',
  output: {
    file: 'dist/bundle.js',
    format: 'esm'
  }
});

Custom Plugin Support

This feature shows how to extend the Rollup configuration with custom plugins. By using the createRollupConfig function, you can easily add your own plugins to the Rollup build process, allowing for greater customization and flexibility.

const { createRollupConfig } = require('@nrwl/rollup');
const myCustomPlugin = require('./my-custom-plugin');

module.exports = createRollupConfig({
  input: 'src/index.ts',
  output: {
    file: 'dist/bundle.js',
    format: 'umd'
  },
  plugins: [myCustomPlugin()]
});

Other packages similar to @nrwl/rollup

Keywords

FAQs

Package last updated on 04 Oct 2024

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