An open API service indexing awesome lists of open source software.

https://github.com/doasync/context-empty-loader

Webpack loader that returns an empty module for specific folders
https://github.com/doasync/context-empty-loader

Last synced: 12 months ago
JSON representation

Webpack loader that returns an empty module for specific folders

Awesome Lists containing this project

README

          

Webpack loader
===================

This loader can exclude/skip/empty modules by context/folder/path they were requested from.
----------

Installation
-------------

```bash
npm install --save-dev context-empty-loader
```

Usage
-------------------

Webpack rule:
```javascript
// Skips all polyfills from specifed paths
{
test: `${paths.modules}/core-js/`,
use: {
loader: 'context-empty-loader',
options: {
context: [
`${paths.modules}/some-module/es/path/`,
`${paths.modules}/another-module/`
]
}
},
},
```

Testing function is **startsWith()**