
Security News
GitHub Actions Checkout Now Blocks Risky pull_request_target Checkouts
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.
babel-plugin-injectcomponentcode
Advanced tools
npm i babel-plugin-injectcomponentcode
const babelPluginInjectComponentCode = require('babel-plugin-injectcomponentcode');
// babel.config.js
// 在 next | react 框架中 指定 jsx文件 进行 高阶组件行为
// options 配置
// importComponentFilePath -> import 组件的 file path
// importComponentName -> import 组件的 name
// isImportDefault(可选参数) -> 是否默认导出(默认是 true)
// needWrapperFileRelativePath(可选参数) -> 需要被包裹的组件的相对路径
module.exports = {
...
plugins: [
...
[[
injectcomponentcode, {
importComponentFilePath: '@/components/PageWrapper',
importComponentName: 'PageWrapper',
isImportDefault: true,
}
]]
]
}
import xx from 'xx'
const Demo = () => {
}
export default Demo
import PageWrapper from '@/components/PageWrapper'
import xx from 'xx'
const Demo = () => {
}
export default PageWrapper(Demo)
FAQs
babel plugin react nextjs inject code
The npm package babel-plugin-injectcomponentcode receives a total of 29 weekly downloads. As such, babel-plugin-injectcomponentcode popularity was classified as not popular.
We found that babel-plugin-injectcomponentcode demonstrated a healthy version release cadence and project activity because the last version was released less than 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 Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.

Product
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.

Product
Socket MCP now lets AI assistants review org alerts, investigate threats using the Socket threat feed, and inspect package files in addition to dependency scoring.