Registry / devops / ignore-loader

ignore-loader

JSON →
library0.1.2jsnpmunverified

ignore-loader is a Webpack loader designed to prevent specified files from being processed and bundled by Webpack. It achieves this by essentially replacing the content of matched modules with an empty string, effectively omitting them from the final build output. First published 9 years ago and last updated in 2017 (version 0.1.2), it is considered an abandoned package. This loader is primarily relevant for older Webpack configurations (versions 1-3) that utilized the `module.loaders` array syntax, as modern Webpack (versions 4+) uses `module.rules`. It doesn't receive new features or bug fixes, and its utility is largely superseded by more flexible configuration options or newer community loaders.

npm install ignore-loader
INSTALL
IMPORT
SIG · IGNORE-LOADER
I
ignore-loader
devopsjavascriptv0.1.2
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.

'ignore-loader'
module: { loaders: [{ test: /\.css$/, loader: 'ignore-loader' }] }
import ignoreLoader from 'ignore-loader'; // Loaders are referenced as strings in webpack.config.js, not imported as modules require('ignore-loader'); // Not how loaders are consumed
Loaders are referenced as string values in the `webpack.config.js` configuration file, specifically within the `module.loaders` array for older Webpack versions (1-3). They are not imported into JavaScript application code directly.
Loader configuration (Webpack 1-3)
module: { loaders: [ { test: /\.(png|jpg|gif)$/, loader: 'ignore-loader' } ] }
module: { rules: [ { test: /\.(png|jpg|gif)$/, use: ['ignore-loader'] } ] } // 'rules' and 'use' are for Webpack 4+; this loader uses 'loaders' and 'loader'
This loader is designed for Webpack 1-3's `module.loaders` configuration. Modern Webpack (4+) uses `module.rules` and `use` for loaders, which is not compatible with this package's intended usage.

Demonstrates configuring `ignore-loader` in an older Webpack `webpack.config.js` to prevent CSS and specific image files from being bundled. This configuration utilizes the `module.loaders` syntax specific to Webpack versions 1-3.

/* webpack.config.js (for Webpack 1-3) */ module.exports = { entry: './src/index.js', output: { filename: 'bundle.js', path: require('path').resolve(__dirname, 'dist'), }, module: { // This loader configuration is for Webpack versions 1, 2, or 3. // It will prevent any .css files from being processed or bundled. // They will effectively be ignored during the build. loaders: [ { test: /\.css$/, loader: 'ignore-loader' }, // Example for ignoring specific images as well { test: /\.(png|jpg|gif)$/, include: require('path').resolve(__dirname, 'src/assets/ignored-images'), loader: 'ignore-loader' } ] }, // For Webpack 4+, 'module.rules' is used instead of 'module.loaders'. // This loader is not recommended for modern Webpack versions. };
Debug
Known issues
breakingThe `module.loaders` configuration array used by `ignore-loader` was deprecated in Webpack 2 and completely removed in Webpack 4. Using this loader or its configuration style with Webpack 4 or newer will result in configuration errors.
fix
Migrate your Webpack configuration to use `module.rules` and `use` property, or find an alternative method for ignoring modules that is compatible with modern Webpack. For example, `null-loader` or `raw-loader` with an empty string return can achieve similar results in `module.rules`.
affects: >=4.0.0
gotcha`ignore-loader` effectively removes the content of matched files from the bundle, but it does not remove references to those files in your source code. If your application code still attempts to import or use the ignored assets, it might lead to runtime errors (e.g., `Module not found`) if a subsequent loader or runtime expects the asset to be present.
fix
Ensure that files ignored by `ignore-loader` are also not referenced by your application code, or implement conditional imports/requires that check for environment variables (e.g., `process.env.NODE_ENV === 'test'`).
affects: >=0.1.0
deprecatedThis package is abandoned. Its last publish was 9 years ago (as of April 2026), and there has been no significant activity on its GitHub repository since 2017. It is not maintained, and there are no plans for updates or compatibility with newer Webpack versions.
fix
Consider migrating to alternative solutions or a custom loader if you need similar functionality in a modern Webpack setup. Relying on abandoned packages can introduce security risks and compatibility issues in the long term.
affects: >=0.1.0
Errors
Common errors & fixes
ERROR in Configuration has an unknown property 'loaders'. These properties are valid: ...
Using `module.loaders` (an older Webpack configuration syntax) in Webpack version 4 or newer.
fix
Update your Webpack configuration to use `module.rules` instead of `module.loaders`. This `ignore-loader` package is specifically for older Webpack versions and will not work with `module.rules` directly without an adapter or wrapper.
Module parse failed: Unexpected token (1:0) You may need an appropriate loader to handle this file type...
Attempting to `require()` or `import` `ignore-loader` directly into JavaScript code, or using it incorrectly in `webpack.config.js` for an older Webpack version where the loader itself fails to transform the module.
fix
Ensure `ignore-loader` is only referenced as a string within the `module.loaders` array of your `webpack.config.js` (for Webpack 1-3). Loaders are processing steps, not modules to be imported into your application's runtime.
Upgrade
Version history
0.1.2latest on npm
Audit
Dependencies
webpackrequiredRequired for the loader to function within a Webpack build process. It's an implicit peer dependency.
Agent activity
4 hits · last 30 days
node
4
Resources
ignore-loader — npm install ignore-loader · libregistry