Skip to content

Instantly share code, notes, and snippets.

@MFCo
Created June 21, 2019 10:07
exports.default = function (_ref) {
var t = _ref.types;
return {
visitor: {
Program: {
exit(path, state) {
/*
At the end we want to write the CSS files
*/
}
},
Class: {
enter(path, state) {
/*
When we enter a Class node we want to check if this Class has custom tags
and generate the CSS
*/
}
},
ClassMethod: {
enter(path, state) {
/*
If the method is componentStyle we want to remove it because we have already generated
the CSS code
*/
}
},
JSXElement: {
enter(path, state) {
/*
If this is a custom JSXElement we want to replace it by a standard JSXElement
*/
}
}
}
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment