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
- Host: GitHub
- URL: https://github.com/doasync/context-empty-loader
- Owner: doasync
- License: mit
- Created: 2017-11-21T00:24:56.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-01-03T19:01:22.000Z (about 3 years ago)
- Last Synced: 2025-03-11T14:37:25.557Z (12 months ago)
- Language: JavaScript
- Size: 4.88 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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()**