1 | import {isElementMarker} from './ast';
|
2 | import transformation from './transformation';
|
3 |
|
4 |
|
5 | module.exports = function() {
|
6 | return {
|
7 | visitor: {
|
8 | JSXElement: {
|
9 | enter: function(path) {
|
10 | const {node} = path;
|
11 | if (isElementMarker(node) && transformation.needsTransformation(node)) {
|
12 | path.replaceWith(transformation.transformElementMarker(node));
|
13 | }
|
14 | }
|
15 | }
|
16 | }
|
17 | };
|
18 | };
|