/
dedaMazai
/
reactGoodPattern
Обзор
Документация
Войти
/
dedaMazai
/
reactGoodPattern
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
moduleFederation/container/config/babel/babelRemovePropsPlugin.ts
21 строка
569 B
Andrey Chipizubov
add microFronts
25 май 2023, 01:05
25 май 2023, 01:05
ec973d2
Код
Авторство
О чём код?
import { PluginItem } from "@babel/core"; export default function (): PluginItem { return { visitor: { Program(path, state) { const forbidden = state.opts.props || []; path.traverse({ JSXIdentifier(current) { const nodeName = current.node.name; if (forbidden.includes(nodeName)) { current.parentPath.remove(); } }, }); }, }, }; }