
Product
A Fresh Look for the Socket Dashboard
We’ve redesigned the Socket dashboard with simpler navigation, less visual clutter, and a cleaner UI that highlights what really matters.
lerna-alias
Advanced tools
Simple package for getting alias object for packages managed by lerna, so other tools (such as webpack, rollup, jest and possibly more) can consume your packages directly from the source files, instead of the built and prepared distribution files.
It just eases development and setting up scripts depending on other lerna packages.
lernaAliases({
// from which directory lerna monorepo should be searched for
directory: string = process.cwd(),
// optional array of `mainFields` that should be used to resolv package's entry point
// similar to the https://webpack.js.org/configuration/resolve/#resolve-mainfields
// using this takes precedence over default `sourceDirectory` option
mainFields?: string[],
// which directory should be considered as containing source files of a package
// if specified as false it will use package's root and rely on a tool's (i.e. webpack) resolving algorithm
sourceDirectory: string | false = 'src'
}): Aliases
Aliases
type Aliases = {
// value is a local directory path to the package
// resolved using `sourceDirectory` and `mainFields` options
[packageName: string]: string,
}
const { webpack: lernaAliases } = require('lerna-alias')
module.exports = {
// ...
resolve: {
// ...
alias: lernaAliases(),
},
}
const { rollup: lernaAliases } = require('lerna-alias')
const lernaAliases = require('lerna-alias')
module.exports = {
// ...
plugins: [
// ...
alias(lernaAliases()),
],
}
const { jest: lernaAliases } = require('lerna-alias')
module.exports = {
// ...
moduleNameMapper: lernaAliases(),
}
mainFields
optionconst { jest: lernaAliases } = require('lerna-alias')
module.exports = {
// ...
moduleNameMapper: lernaAliases({ mainFields: ['main'] }),
}
FAQs
Get aliases for your lerna packages for the other tools
The npm package lerna-alias receives a total of 389 weekly downloads. As such, lerna-alias popularity was classified as not popular.
We found that lerna-alias 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.
Product
We’ve redesigned the Socket dashboard with simpler navigation, less visual clutter, and a cleaner UI that highlights what really matters.
Industry Insights
Terry O’Daniel, Head of Security at Amplitude, shares insights on building high-impact security teams, aligning with engineering, and why AI gives defenders a fighting chance.
Security News
MCP spec updated with structured tool output, stronger OAuth 2.1 security, resource indicators, and protocol cleanups for safer, more reliable AI workflows.