New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

babel-plugin-module-alias

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-module-alias - npm Package Compare versions

Comparing version 0.1.2 to 0.2.0

2

package.json
{
"name": "babel-plugin-module-alias",
"version": "0.1.2",
"version": "0.2.0",
"main": "lib/index.js",

@@ -5,0 +5,0 @@ "description": "Babel plugin to rewrite the path in require() and ES6 import",

@@ -29,2 +29,27 @@ # Module alias plugin for Babel

```
Module aliasing also works for a single modules. Given this config in `.babelrc`:
```
{
"plugins": [
"babel-plugin-module-alias"
],
"extra": {
"module-alias": [
{
"src": "../some-path/more-folders/my-awesome-lib",
"expose": "my-awesome-lib"
}
]
}
}
```
In your code you can simply do:
```js
import MyAwesomeLib from 'my-awesome-lib';
```
_Note:_ the section `extra` is a custom section commonly used by plugins to take options. There's currently no better way in Babel to pass options to plugins.

@@ -31,0 +56,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc