You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
557 B
25 lines
557 B
module.exports = function ({
|
|
types: t
|
|
}) {
|
|
return {
|
|
visitor: {
|
|
MemberExpression (path, state) {
|
|
if (
|
|
t.isIdentifier(path.node.property) &&
|
|
path.node.property.name === '$mount' &&
|
|
!path.node.$createApp
|
|
) {
|
|
path.node.$createApp = true
|
|
path.get('object').replaceWith(
|
|
t.callExpression(
|
|
t.identifier('createApp'),
|
|
[
|
|
path.node.object
|
|
]
|
|
)
|
|
)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|