@hh.ru/babel-plugin-insert-pathname

Babel plugin, which allows to add filename as an argument into function call

Usage no npm install needed!

<script type="module">
  import hhRuBabelPluginInsertPathname from 'https://cdn.skypack.dev/@hh.ru/babel-plugin-insert-pathname';
</script>

README

Специфический babel.plugin для добавления имени компонента к вызову фабрики компонента

Фабрика имеет вид:

Components.build({
    create() {

    },
    ...
})

Матчимся на это знание и добавляем также информацию о компоненте:

Components.build({
    create() {

    },
    componentName: 'bla-bla',
    ...
})

Установка

yarn add --dev @hh.ru/babel-plugin-insert-pathname

Добавить @hh.ru/babel-plugin-insert-pathname в .babelrc файл:

{
    "plugins": ["@hh.ru/babel-plugin-insert-pathname"]
}