Newer
Older
# @svgr/hast-util-to-babel-ast
[](https://travis-ci.org/smooth-code/svgr)
[](https://www.npmjs.com/package/@svgr/hast-util-to-babel-ast)
[](https://github.com/smooth-code/svgr/blob/master/LICENSE)
Transforms HAST into Babel AST.
## Install
```
npm install --save-dev @svgr/hast-util-to-babel-ast
```
## Usage
```js
import toBabelAST from '@svgr/hast-util-to-babel-ast'
const hastTree = unified()
.use(parse, {
fragment: true,
space: 'svg',
})
.parse(vfile({ path: filePath, contents: `<svg></svg>` }))
const babelTree = hastToBabelAst(hastTree)
```
## License
MIT