
Research
Malicious npm Package Brand-Squats TanStack to Exfiltrate Environment Variables
A brand-squatted TanStack npm package used postinstall scripts to steal .env files and exfiltrate developer secrets to an attacker-controlled endpoint.
liferay-npm-bundler-plugin-replace-browser-modules
Advanced tools
A liferay-npm-bundler plugin to replace files listed under the browser/module entry of package.json files.
Rewrite aliased modules (those under
browsersection or any other configured alias field ofpackage.jsonfiles) to that they reexport their targets.
npm install --save-dev liferay-npm-bundler-plugin-replace-browser-modules
Add the following to your .npmbundlerrc file:
{
"*": {
"plugins": ["replace-browser-modules"]
}
}
The plugin can be configured using .npmbundlerrc global config section or in the plugin configuration itself.
In both cases the structure is the same:
{
"resolve": {
"aliasFields": ["browser"]
}
}
This resembles webpack's resolve.aliasFields which serves the same purpose.
Normally global config is preferred, but you can leverage plugin configuration when you need different alias fields for different packages.
The default value for resolve.aliasFields is ['browser'] as in webpack.
Note that this plugin used to look for unpkg and jsdelivr fields too, but it caused problems (see https://github.com/liferay/liferay-js-toolkit/issues/365 for more information).
This plugin scans package.json for fields defined in resolve.aliasFields and redirects aliased modules to their configured target or empties them when set to false.
This plugin only does one part of the whole implementation of the aliases. Aliases implementation have two parts:
They redirect existing modules or provide virtual ones when seen from the outside, from another package.
They make local requires divert to a different target.
This plugin does only the 1st part. The second one is performed by babel-plugin-alias-modules.
Please read the browser field specification for more information.
FAQs
A liferay-npm-bundler plugin to replace files listed under the browser/module entry of package.json files.
The npm package liferay-npm-bundler-plugin-replace-browser-modules receives a total of 4,969 weekly downloads. As such, liferay-npm-bundler-plugin-replace-browser-modules popularity was classified as popular.
We found that liferay-npm-bundler-plugin-replace-browser-modules demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 14 open source maintainers 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.

Research
A brand-squatted TanStack npm package used postinstall scripts to steal .env files and exfiltrate developer secrets to an attacker-controlled endpoint.

Research
Compromised SAP CAP npm packages download and execute unverified binaries, creating urgent supply chain risk for affected developers and CI/CD environments.

Company News
Socket has acquired Secure Annex to expand extension security across browsers, IDEs, and AI tools.