# null-loader

> A webpack loader that returns an empty module.

Latest version **4.0.1** (published 2020-10-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install null-loader
pnpm add null-loader
yarn add null-loader
bun add null-loader
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.0.1 |
| Published | 2020-10-09 |
| First published | 2014-07-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 10.13.0 |
| Dependencies | 2 |
| Unpacked size | 7.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 144 |
| Author | Tobias Koppers @sokra |
| Maintainers | d3viant0ne, evilebottnawi, sokra, jhnns, michael-ciniawsky, bebraw, ericclemmons, thelarkinn |
| Keywords | webpack |

## Links

- npm: https://www.npmjs.com/package/null-loader
- Repository: https://github.com/webpack-contrib/null-loader
- Issues: https://github.com/webpack-contrib/null-loader/issues
- Funding: https://opencollective.com/webpack
- npm.io page: https://npm.io/package/null-loader

## Dependencies (2)

- [loader-utils](https://npm.io/package/loader-utils.md) ^2.0.0
- [schema-utils](https://npm.io/package/schema-utils.md) ^3.0.0

## Alternatives

- [raw-loader](https://npm.io/package/raw-loader.md) — 4.3M weekly downloads
- [plop](https://npm.io/package/plop.md) — 1.4M weekly downloads
- [webpack-deadcode-plugin](https://npm.io/package/webpack-deadcode-plugin.md) — 80.3K weekly downloads
- [@storybook/preact-vite](https://npm.io/package/@storybook/preact-vite.md) — 54.2K weekly downloads
- [vite-plugin-transform](https://npm.io/package/vite-plugin-transform.md) — 2.4K weekly downloads

## Recent versions

- 4.0.1 (latest) — 2020-10-09
- 4.0.0 — 2020-04-15
- 3.0.0 — 2019-06-05
- 2.0.0 — 2019-05-15
- 1.0.0 — 2019-04-23
- 0.1.1 — 2015-02-13
- 0.1.0 — 2014-07-23

## README

<div align="center">
  <a href="https://github.com/webpack/webpack">
    <img width="200" height="200" src="https://webpack.js.org/assets/icon-square-big.svg">
  </a>
</div>

[![npm][npm]][npm-url]
[![node][node]][node-url]
[![deps][deps]][deps-url]
[![tests][tests]][tests-url]
[![chat][chat]][chat-url]
[![size][size]][size-url]

# null-loader

A webpack loader that returns an empty module.

One use for this loader is to silence modules imported by a dependency. Say, for
example, your project relies on an ES6 library that imports a polyfill you don't
need, so removing it will cause no loss in functionality.

## Getting Started

To begin, you'll need to install `null-loader`:

```console
$ npm install null-loader --save-dev
```

Then add the loader to your `webpack` config. For example:

```js
// webpack.config.js
const path = require('path');

module.exports = {
  module: {
    rules: [
      {
        // Test for a polyfill (or any file) and it won't be included in your
        // bundle
        test: path.resolve(__dirname, 'node_modules/library/polyfill.js'),
        use: 'null-loader',
      },
    ],
  },
};
```

And run `webpack` via your preferred method.

## Contributing

Please take a moment to read our contributing guidelines if you haven't yet done so.

[CONTRIBUTING](./.github/CONTRIBUTING.md)

## License

[MIT](./LICENSE)

[npm]: https://img.shields.io/npm/v/null-loader.svg
[npm-url]: https://npmjs.com/package/null-loader
[node]: https://img.shields.io/node/v/null-loader.svg
[node-url]: https://nodejs.org
[deps]: https://david-dm.org/webpack-contrib/null-loader.svg
[deps-url]: https://david-dm.org/webpack-contrib/null-loader
[tests]: https://github.com/webpack-contrib/null-loader/workflows/null-loader/badge.svg
[tests-url]: https://github.com/webpack-contrib/null-loader/actions
[cover]: https://codecov.io/gh/webpack-contrib/null-loader/branch/master/graph/badge.svg
[cover-url]: https://codecov.io/gh/webpack-contrib/null-loader
[chat]: https://img.shields.io/badge/gitter-webpack%2Fwebpack-brightgreen.svg
[chat-url]: https://gitter.im/webpack/webpack
[size]: https://packagephobia.now.sh/badge?p=null-loader
[size-url]: https://packagephobia.now.sh/result?p=null-loader

---
_Source: https://npm.io/package/null-loader · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
