Registry / devops / rollup-plugin-no-emit

rollup-plugin-no-emit

JSON →
library1.3.0jsnpmunverified

A Rollup plugin that conditionally skips file emission during build. v1.3.0 supports Rollup 1.x through 4.x as peer dependencies and ships TypeScript typings. It provides a `match` function receiving the filename and output chunk/asset to decide which generated files to suppress. Unlike Rollup's built-in `output.preserveModules` or `output.emitFile` controls, this plugin gives fine-grained per-file filtering without altering bundle structure. The deprecated `RollupNoEmitOptions` interface has been replaced by `Options`. Simple API with two options: `emit` (boolean override) and `match` (predicate). No runtime dependencies.

npm install rollup-plugin-no-emit
INSTALL
IMPORT
SIG · ROLLUP-PLUGIN-NO-E
R
rollup-plugin-no-emit
devopsjavascriptv1.3.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18223 runs
build_error
glibc
node 18223 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default (noEmit)
import noEmit from 'rollup-plugin-no-emit'
const noEmit = require('rollup-plugin-no-emit')
Package exports a default function; CommonJS require() works since v1.2.0 but ESM is preferred.
noEmit (named)
import { noEmit } from 'rollup-plugin-no-emit'
import noEmit from 'rollup-plugin-no-emit'
Both default and named exports exist; named export is available for consistency.
Options
import type { Options } from 'rollup-plugin-no-emit'
import { Options } from 'rollup-plugin-no-emit'
Options is a TypeScript type; use type import to avoid runtime inclusion.
RollupNoEmitOptions (deprecated)
import type { RollupNoEmitOptions } from 'rollup-plugin-no-emit'
Deprecated since v1.2.0; replaced by Options. Will be removed in next major.

Example rollup.config.js using noEmit with a match function that skips emission of 'index.js' chunks.

import noEmit from 'rollup-plugin-no-emit'; export default { input: 'src/index.js', output: { dir: 'dist' }, plugins: [ noEmit({ match: (fileName, output) => fileName === 'index.js' && output.type === 'chunk' }) ] };
Debug
Known issues
deprecatedRollupNoEmitOptions interface is deprecated; use Options instead.
fix
Replace type references from RollupNoEmitOptions to Options.
affects: >=1.2.0
breakingIn v1.0.0, match function signature changed to include second parameter (output: OutputChunk | OutputAsset).
fix
Update match callback to accept the new signature: (fileName, output) => boolean.
affects: <1.0.0
gotchaPlugin only works in the generateBundle hook; output must be defined.
fix
Ensure Rollup configuration has output specified.
affects: >=0.0.1
gotchaUsing noEmit with output.preserveModules or manualChunks may lead to unexpected behavior as the plugin suppresses files after chunking.
fix
Test match conditions thoroughly when combining with other output options.
affects: >=0.0.1
Errors
Common errors & fixes
Error: Rollup's generateBundle hook: Cannot read properties of null (reading 'fileName')
match function called with undefined/null output chunk when output is not properly configured.
fix
Check that output.dir or output.file is set in Rollup config.
TypeError: noEmit is not a function
Importing the constructor function when using CommonJS require incorrectly: const noEmit = require('rollup-plugin-no-emit'); but actual export is an object with default.
fix
Use const noEmit = require('rollup-plugin-no-emit').default; or switch to ESM import.
Error: Cannot find module 'rollup-plugin-no-emit'
Package not installed.
fix
Run npm install --save-dev rollup-plugin-no-emit
TS2304: Cannot find name 'Options'
Imported Options as a value instead of type.
fix
Use import type { Options } from 'rollup-plugin-no-emit';
Upgrade
Version history
1.3.0latest on npm
Audit
Dependencies
rolluprequiredPeer dependency - the plugin operates on Rollup's plugin hooks
Agent activity
2 hits · last 30 days
node
2
Resources
rollup-plugin-no-emit — npm install rollup-plugin-no-emit · libregistry