Package Exports
- null-loader
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (null-loader) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
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-devThen 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.