
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
babel-plugin-module-resolve
Advanced tools
babel-plugin-module-resolveA Babel plugin to import similar to webpack alias.
Implemented based on plugin enhanced-resolve.
Simplify the require import System.import System.import path.
// simple @utils -> <root dir>/utils
import t from '@utils';
// instead
import t from '../../utils/index';
const t = require('@utils');
// instead
const t = require('../../utils/index');
Install the plugin
npm install --save-dev babel-plugin-module-resolve`
or
yarn add --dev babel-plugin-module-resolve`
Specify the plugin in your .babelrc with the custom root or alias. Here's an example:
{
"plugins": [
[
"module-resolve",
{
"roots": ["./src"],
"alias": {
"@/*": ["./*"],
"assets": ["./assets"]
}
}
]
]
}
Also supports the use of paths configuration in jsconfig and tsconfig.
{
"compilerOptions": {
"baseUrl": "src",
"paths": {
"@/*": ["./*"]
}
}
}
Detailed reference enhanced-resolve.
Parsed root directory
arraycwd | compilerOptions.baseUrlAlias configuration
object{ @: resolve('src') } | compilerOptions.pathsParse file types
array['.js', '.jsx', '.es', '.es6', '.mjs', '.ts', '.tsx']FAQs
Module resolver plugin for Babel
The npm package babel-plugin-module-resolve receives a total of 217 weekly downloads. As such, babel-plugin-module-resolve popularity was classified as not popular.
We found that babel-plugin-module-resolve demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.