Socket
Socket
Sign inDemoInstall

rollup-plugin-no-emit

Package Overview
Dependencies
1
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

rollup-plugin-no-emit

A Rollup plugin that skips emit for generated bundles.


Version published
Weekly downloads
641
decreased by-25.98%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

rollup-plugin-no-emit

npm Node.js CI

A Rollup plugin that skips emit for generated bundles.

Install

npm install --save-dev rollup-plugin-no-emit

Usage

// ES6
import noEmit from 'rollup-plugin-no-emit';

// CommonJS
const { noEmit } = require('rollup-plugin-no-emit');

Use the plugin, example rollup.config.js:

import noEmit from 'rollup-plugin-no-emit';

export default {
  input: 'src/index.js',
  output: { dir: 'dist' },
  plugins: [noEmit(/* plugin options */)]
};

Options

You can pass an options object to noEmit with the following properties:

emit

Type: boolean
Default: false

Set to true to invalidate plugin and emit files.

match

Type: (fileName: string, output: OutputChunk | OutputAsset) => boolean

Return true to skip emit for output file.

In the example below (rollup.config.js), the output file dist/index.js is emitted while dist/output.js is skipped:

import noEmit from 'rollup-plugin-no-emit';

export default {
  input: 'src/index.js',
  output: [{ file: 'dist/index.js' }, { file: 'dist/output.js' }],
  plugins: [noEmit({ match: file => file === 'output.js' })]
};

License

Licensed under the MIT License.

Keywords

FAQs

Last updated on 27 Apr 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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc