Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Feb 26, 2024 via pnpm

babel-plugin-module-resolver 2.0.0

Babel plugin to rewrite the path in require() and ES6 import
Package summary
Share
0
issues
1
license
1
MIT
Package created
14 Aug 2016
Version published
14 Aug 2016
Maintainers
2
Total deps
1
Direct deps
0
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
babel-plugin-module-resolver@2.0.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
β“˜ This is a list of babel-plugin-module-resolver 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does babel-plugin-module-resolver do?

Babel-Plugin-Module-Resolver is a Babel plugin that allows you to add new "root" directories containing your modules and set up a custom alias for directories, specific files, or other npm modules. This function is particularly useful in simplifying the import/require paths in your code, letting you write utils/my-utils instead of ../../../../utils/my-utils, hence speeding up your workflows and eliminating the need to compute how many directory levels to traverse up before accessing a file.

How do you use babel-plugin-module-resolver?

Utilizing Babel-Plugin-Module-Resolver is straightforward. First, install the plugin by running npm install --save-dev babel-plugin-module-resolver or yarn add --dev babel-plugin-module-resolver. Subsequently, define the plugin in your .babelrc with custom root or alias. Below is a usage example:

{
  "plugins": [
    ["module-resolver", {
      "root": ["./src"],
      "alias": {
        "test": "./test",
        "underscore": "lodash"
      }
    }]
  ]
}

In case you're using a .babelrc.js, specify the plugin like this:

const plugins = [
  [
    require.resolve('babel-plugin-module-resolver'),
    {
      root: ["./src/"],
      alias: {
        "test": "./test"
      }
    }
  ]
];

Where are the babel-plugin-module-resolver docs?

You can find the detailed documentation for Babel-Plugin-Module-Resolver at DOCS.md. Here, you'll find comprehensive information about the plugin, including how to configure and control it. In addition, if you're a plugin author, you'll find the documented exposed functions quite useful. This ensures you've got all the information necessary to get the most out of Babel-Plugin-Module-Resolver.