Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/olehdutchenko/babel-loader-exclude-node-modules-except
Creating a regular expression for excluding node modules from transpiling except for individual modules
https://github.com/olehdutchenko/babel-loader-exclude-node-modules-except
babel-loader es6-modules exclude js-tiny-module node-modules webpack
Last synced: 19 days ago
JSON representation
Creating a regular expression for excluding node modules from transpiling except for individual modules
- Host: GitHub
- URL: https://github.com/olehdutchenko/babel-loader-exclude-node-modules-except
- Owner: OlehDutchenko
- License: mit
- Created: 2018-10-12T15:05:54.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-06-18T17:21:11.000Z (5 months ago)
- Last Synced: 2024-10-14T00:49:51.963Z (about 1 month ago)
- Topics: babel-loader, es6-modules, exclude, js-tiny-module, node-modules, webpack
- Language: JavaScript
- Size: 2.84 MB
- Stars: 19
- Watchers: 2
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# babel-loader-exclude-node-modules-except
[![license](https://img.shields.io/badge/License-MIT-green.svg)](https://github.com/WezomAgency/babel-loader-exclude-node-modules-except/blob/master/LICENSE)
[![npm](https://img.shields.io/badge/js--tiny-module-yellow.svg)](https://github.com/topics/js-tiny-module)
[![npm](https://img.shields.io/badge/npm-install-orange.svg)](https://www.npmjs.com/package/babel-loader-exclude-node-modules-except)
![Tests](https://github.com/dutchenkoOleg/babel-loader-exclude-node-modules-except/workflows/Tests/badge.svg)| Statements | Branches | Functions | Lines |
| --------------------------- | ----------------------- | ------------------------- | -------------------- |
| ![Statements](https://img.shields.io/badge/Coverage-100%25-brightgreen.svg) | ![Branches](https://img.shields.io/badge/Coverage-100%25-brightgreen.svg) | ![Functions](https://img.shields.io/badge/Coverage-100%25-brightgreen.svg) | ![Lines](https://img.shields.io/badge/Coverage-100%25-brightgreen.svg) |> Creating a regular expression for excluding node_modules
> from babel transpiling except for individual modules### Usage
```js
// webpack.config.jsconst babelLoaderExcludeNodeModulesExcept = require('babel-loader-exclude-node-modules-except');
module.exports = {
// config properties
// ...
module: {
rules: [
{
test: /\.js$/,
exclude: babelLoaderExcludeNodeModulesExcept([
// es6 modules from node_modules/
'custom-jquery-methods',
'swiper',
'dom7'
]),
use: {
loader: 'babel-loader'
}
}
]
}
};```
### Also, wildcards for matching are allowed, except names
_Since v1.2.0_
```js
// webpack.config.jsconst babelLoaderExcludeNodeModulesExcept = require('babel-loader-exclude-node-modules-except');
module.exports = {
// config properties
// ...
module: {
rules: [
{
test: /\.js$/,
exclude: babelLoaderExcludeNodeModulesExcept([
'react-*',
'@awesomecorp/*'
]),
use: {
loader: 'babel-loader'
}
}
]
}
};```
---
#### Contributors 💪
- April Arcus [@AprilArcus](https://github.com/AprilArcus)
- Thordur Thordarson [@earthslasthope](https://github.com/earthslasthope)---
#### License
[MIT License](https://github.com/WezomAgency/babel-loader-exclude-node-modules-except/blob/master/LICENSE)
---