
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
@hon2a/less-vars-loader
Advanced tools
Webpack loader providing a seamless bridge from Less variable sheets to JS files
@hon2a/less-vars-loader
is a Webpack loader providing a seamless bridge from Less variable
sheets to JS files.
Use the loader to extract variables from Less variable sheets (including imports, transitively) and bring them into a JS file as an object. Use inline loader syntax to set this up:
import theme from '!@hon2a/less-vars-loader!./path/to/vars.less'
Note: Use a leading !
to prevent use of other loaders.
If you're not using the file also in regular imports, you may also set up the loader
in webpack.config.js
and take advantage of the transform
option:
module.exports = {
module: {
rules: [
{
test: /\.vars\.less$/,
use: '@hon2a/less-vars-loader',
options: {
transform: ([key, value]) => [camelCase(key), /^\d+px$/.test(value) ? parseInt(value, 10) : value],
lessOptions: { javascriptEnabled: true }
}
}
]
}
}
Note: This loader needs to go before other loaders matching the test
if there are any
(e.g. when also using less-loader
to load other .less
files).
Install dependencies using:
npm install
After you modify sources, run the following (or set up your IDE to do it for you):
npm run format
npm run lint
npm test
and fix the errors, if there are any.
Publishing is done in two steps:
npm version <patch|minor|major>
git push --follow-tags
npm publish --access public
FAQs
Webpack loader providing a seamless bridge from Less variable sheets to JS files
We found that @hon2a/less-vars-loader 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
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.