Fix Relay Babel Plugin in the packager
@@ -67,8 +67,7 @@ module.exports = function BabelPluginRelay(context: {types: BabelTypes}): any {
);
}
- return {
- visitor: {
+ const visitor = {
TaggedTemplateExpression(path, state) {
// Convert graphql`` literals
const ast = getValidGraphQLTag(path);
@@ -104,6 +103,13 @@ module.exports = function BabelPluginRelay(context: {types: BabelTypes}): any {
);
}
},
+ };
+
+ return {
+ visitor: {
+ Program(path, state) {
+ path.traverse(visitor, state);
+ },
},
};
};
