https://github.com/handsontable/babel-plugin-forbidden-imports
Babel plugin which adds you ability to forbidden load specific modules
https://github.com/handsontable/babel-plugin-forbidden-imports
babel babel-plugin
Last synced: 12 months ago
JSON representation
Babel plugin which adds you ability to forbidden load specific modules
- Host: GitHub
- URL: https://github.com/handsontable/babel-plugin-forbidden-imports
- Owner: handsontable
- License: mit
- Created: 2017-04-04T07:36:10.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-07-19T09:55:02.000Z (almost 9 years ago)
- Last Synced: 2024-04-14T11:53:47.080Z (about 2 years ago)
- Topics: babel, babel-plugin
- Language: JavaScript
- Homepage:
- Size: 42 KB
- Stars: 1
- Watchers: 16
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## babel-plugin-forbidden-imports
[](https://travis-ci.org/handsontable/babel-plugin-forbidden-imports)
[](https://npmjs.org/package/babel-plugin-forbidden-imports)
[](https://david-dm.org/handsontable/babel-plugin-forbidden-imports)
[](https://npmjs.org/package/babel-plugin-forbidden-imports)
This is a Babel plugin for static import/require modules checking. Any imported modules (using import or require) by default are forbidden. This plugin
can be helpful in situations when you want to forbidden using specific modules in your environment.
# Installation
Install via [npm](https://npmjs.org/package/babel-plugin-forbidden-imports).
```sh
npm install --save-dev babel-plugin-forbidden-imports
```
# Configuration
Configure it in your babelrc file (`.babelrc`).
```js
{
"env": {
"node": {
"plugins": [
[
"babel-plugin-forbidden-imports",
{
allowedModules: ["./my-local-module", "lodash/*"]
}
]
]
}
}
}
```
or use with `babel-register`
```
require('babel-register')({
plugins: [
[
'babel-plugin-forbidden-imports',
{
allowedModules: ["./my-local-module", "lodash/*"]
}
]
]
});
```
## License
[MIT License](http://opensource.org/licenses/MIT)