Registry / devops / noop-webpack-plugin

noop-webpack-plugin

JSON →
library1.0.1jsnpmunverified

A tiny Webpack plugin that performs no operation, intended as a conditional placeholder when a noop is needed in the plugins array. Version 1.0.1 is the latest and only release. The package is stable but trivial – it creates a no-op plugin that does nothing. It has zero dependencies and is often used to replace a real plugin in development mode. Alternatives include using null or process.env checks directly, but this plugin provides a simple interface.

npm install noop-webpack-plugin
INSTALL
IMPORT
SIG · NOOP-WEBPACK-PLUGI
N
noop-webpack-plugin
devopsjavascriptv1.0.1
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 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

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

default
const noop = require('noop-webpack-plugin');
import noop from 'noop-webpack-plugin';
Package uses CommonJS only; no ESM exports. Use require() in Node.js.
noop
const noop = require('noop-webpack-plugin');
const { noop } = require('noop-webpack-plugin');
The module exports a function directly, not an object. Default import is required.
noop()
plugins: [ isProd ? new UglifyJsPlugin() : noop() ]
plugins: [ noop ]
noop must be called (returns a plugin instance) rather than passed as a class.

Conditionally use UglifyJsPlugin in production or noop in development.

const webpack = require('webpack'); const noop = require('noop-webpack-plugin'); const isProd = process.env.NODE_ENV === 'production'; module.exports = { entry: './src/index.js', output: { path: './dist', filename: 'bundle.js' }, plugins: [ isProd ? new webpack.optimize.UglifyJsPlugin() : noop() ] };
Debug
Known issues
gotchanoop() must be called to get a plugin instance; passing the function directly will cause Webpack to fail.
fix
Use noop() instead of noop in the plugins array.
affects: >=1.0.0
deprecatedThe package is trivial and may not be actively maintained; prefer inline conditionals or use a package-specific noop like webpack's built-in noop?
fix
Consider using `plugins: [ isProd && new UglifyJsPlugin() ].filter(Boolean)` instead.
affects: >=1.0.0
gotchaThe package has no TypeScript typings, causing type errors in TypeScript projects.
fix
Create a declaration file: declare module 'noop-webpack-plugin' { const fn: () => any; export default fn; }
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: noop is not a constructor
Using `new noop()` instead of calling `noop()`.
fix
Use `noop()` instead of `new noop()`.
Cannot find module 'noop-webpack-plugin'
Package not installed or missing from node_modules.
fix
Run `npm install noop-webpack-plugin --save-dev`.
Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema. - configuration.plugins[0] should be a Webpack plugin instance.
Passing the noop function (not called) into plugins array.
fix
Change `plugins: [noop]` to `plugins: [noop()]`.
Upgrade
Version history
1.0.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
noop-webpack-plugin — npm install noop-webpack-plugin · libregistry