1. babel-plugin-forbidden-imports
Forbidden using import/require expression in your files
babel-plugin-forbidden-imports
Package: babel-plugin-forbidden-imports
Created by: handsontable
Last modified: Mon, 13 Jun 2022 04:01:23 GMT
Version: 0.1.2
License: MIT
Downloads: 2,912
Repository: https://github.com/handsontable/babel-plugin-forbidden-imports

Install

npm install babel-plugin-forbidden-imports
yarn add babel-plugin-forbidden-imports

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

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin