airbnb/babel-plugin-inline-react-svg

Need `includePattern` as option

開放

#62 建立於 2019年6月5日

 (11 則留言) (0 個反應) (0 位負責人)JavaScript (90 個分叉)github user discovery
enhancementhelp wanted

倉庫指標

星標
 (474 顆星)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

My issue is that we want to use this babel transform just for icons that we want to style - inline icons that should have the same color as surrounding text, etc.

On the other hand, we'd like to use webpack's url-loader to handle all larger "illustration" SVGs. We would rather put those in img tags and let them be cached by the browser and not have them in our javascript bundle.

To do so, an includePattern could be used that would only use this babel transform on (for example):

  • *.icon.svg
  • */icons/*.svg

Thoughts? I'm about to make a PR.

貢獻者指南