
Security News
High Salaries No Longer Enough to Attract Top Cybersecurity Talent
A survey of 500 cybersecurity pros reveals high pay isn't enough—lack of growth and flexibility is driving attrition and risking organizational security.
babel-plugin-demand
Advanced tools
#babel-plugin-demand
用于公共 js 库按需加载的babel插件
npm i babel-plugin-demand -D
在 .babelrc
或者 babel-loader 文件中配置
{
"plugins": [
[
"demand", {
packageName: 'xx-sdk',
redirect: 'lib'
// ...options
}
]
]
}
import { foo } from 'xx-sdk'
foo()
上述代码会被转为
import _foo from 'xx-sdk/lib/foo'
_foo()
参数名称 | 含义 | 类型 | 是否必填 | 默认值 |
---|---|---|---|---|
packageName | js 包的名字 | String | 是 | 无 |
redirect | 函数所在的目录 | String | 否 | 'lib' |
camel2Dash | 驼峰文件名是否需要转为 '-' 连接 | Boolean | 否 | false |
FAQs
按需加载babel插件
We found that babel-plugin-demand 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
A survey of 500 cybersecurity pros reveals high pay isn't enough—lack of growth and flexibility is driving attrition and risking organizational security.
Product
Socket, the leader in open source security, is now available on Google Cloud Marketplace for simplified procurement and enhanced protection against supply chain attacks.
Security News
Corepack will be phased out from future Node.js releases following a TSC vote.