Nanobots Protecting Microbots
Miss any of our Open RFC calls?Watch the recordings here! »

babel-plugin-forbidden-imports

0.1.2 • Public • Published

babel-plugin-forbidden-imports

Build Status NPM Dependencies License

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.

npm install --save-dev babel-plugin-forbidden-imports

Configuration

Configure it in your babelrc file (.babelrc).

{
  "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

Keywords

Install

npm i babel-plugin-forbidden-imports

DownloadsWeekly Downloads

1,312

Version

0.1.2

License

MIT

Last publish

Collaborators

  • avatar
  • avatar
  • avatar