mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2026-07-28 16:52:37 -04:00
Fixed issues with JSX.createElement definitions
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
* IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
import { transform } from "babel-core"
|
||||
import jsdoc2flow from "flow-jsdoc"
|
||||
import through from "through2"
|
||||
|
||||
@@ -37,9 +38,18 @@ export default (gulp, config) => {
|
||||
if (file.isNull() || file.isStream())
|
||||
return done()
|
||||
|
||||
/* Perform Babel transformation to resolve JSX calls */
|
||||
const transformed = transform(file.contents.toString(), {
|
||||
plugins: [
|
||||
["transform-react-jsx", {
|
||||
"pragma": "Jsx.createElement"
|
||||
}]
|
||||
]
|
||||
})
|
||||
|
||||
/* Annotate contents */
|
||||
file.contents = new Buffer(jsdoc2flow(
|
||||
`/* @flow */\n\n${file.contents.toString()}`
|
||||
`/* @flow */\n\n${transformed.code}`
|
||||
).toString())
|
||||
|
||||
/* Push file to next stage */
|
||||
|
||||
Reference in New Issue
Block a user