Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@automattic/calypso-babel-config
Advanced tools
Shared babel configuration used in Calypso projects
This package exports the configuration used for Calypso projects in ./babel.config.js
. It is recommended to have your own babel.config.js
in the root of the project and extend from this one. Example:
const { babelConfig } = require( '@automattic/calypso-babel-config' );
module.exports = babelConfig();
It supports a few configuration options:
isBrowser
: boolean, whether the config is meant to be used in a Browser or in Node.js.outputPOT
: string, path to store the .POT files with the translationsExample (with default values):
const { babelConfig } = require( '@automattic/calypso-babel-config' );
module.exports = babelConfig( {
isBrowser: true,
outputPOT: './build',
} );
It exports three presets:
presets/default
: default preset used in Calypsopresets/dependencies
: used to transpile selected NPM dependencies from ESnext to the target's ES version.presets/wordpress-element
: used to transpile code for WordpressExample:
module.exports = {
presets: [
'@automattic/calypso-babel-config/presets/wordpress-element',
'@automattic/calypso-babel-config/presets/default',
],
plugins: [ 'my-custom-babel-plugin' ],
};
The default
preset has a modules
option that specifies whether we want to transpile ESM import
and export
statements. Most common values are false
, which keeps these statements intact and results in ES modules as output, and 'commonjs'
, which transpiles the module to the CommonJS format. See the @babel/preset-env documentation for more details.
module.exports = {
presets: [ [ '@automattic/calypso-babel-config/presets/default', { modules: 'commonjs' } ] ],
};
Another way to set the modules
option is to set the MODULES
environment variable to 'esm'
(maps to false
) or any other valid value. That's convenient for running Babel from command line, where specifying options for presets (--presets=...
) is not supported.
The default
preset also specifies corejs
, debug
, and useBuiltIns
options that's passed through to @babel/preset-env.
FAQs
Shared babel configuration used in Calypso projects
The npm package @automattic/calypso-babel-config receives a total of 53 weekly downloads. As such, @automattic/calypso-babel-config popularity was classified as not popular.
We found that @automattic/calypso-babel-config demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 33 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
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.