null-loader
A webpack loader that returns an empty module.
Last updated 6 years ago by evilebottnawi .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install null-loader 
SYNC missed versions from official npm registry.

npm node deps tests chat size

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:

$ npm install null-loader --save-dev

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

// 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

License

MIT

Current Tags

  • 4.0.1                                ...           latest (4 years ago)

7 Versions

  • 4.0.1                                ...           4 years ago
  • 4.0.0                                ...           5 years ago
  • 3.0.0                                ...           5 years ago
  • 2.0.0                                ...           6 years ago
  • 1.0.0                                ...           6 years ago
  • 0.1.1                                ...           10 years ago
  • 0.1.0                                ...           10 years ago
Downloads
Total 1
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (21)
Dependents (2)

© 2010 - cnpmjs.org x YWFE | Home | YWFE