Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
babel-plugin-module-selector
Advanced tools
This plugin allows you to replace one module reference with another module reference based on your setting. You can use this plugin if you have a project where customization of modules is a requirement.
npm install babel-plugin-module-selector
Configure your .babelrc
to use this plugin. An example of it is provided below.
{
"plugins": [
["module-selector", {
"roots": ["src"],
"selectorsRoot": "customizations"
}]
]
}
In roots
you define the folders under which transformations will apply. selectorsRoot
is the root folder where you place all your customization selectors. selectorsRoot
should be within roots
. Each customization selector can mirror a part of the folder structure of your root. I.e:
project
src
a
b
customizations
selectorA
a
selectorB
b
With the example folder structure above, when we build with selector selectorA
, src/customizations/selectorA/a
is used whenever a
is required/imported. However b
is still required/imported from src/b
.
This model allows you to partialy replace a standard version of your app while still reusing most of the code.
You can use the BABEL_MODULE_SELECTOR
environment variable to control which selector to use for builds, or you can add a selector
config to your .babelrc
to do the same.
FAQs
Replace modules based on a selector
The npm package babel-plugin-module-selector receives a total of 2 weekly downloads. As such, babel-plugin-module-selector popularity was classified as not popular.
We found that babel-plugin-module-selector 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
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.