Closed Albert-Gao closed 5 years ago
Hi @Albert-Gao You need to make sure that your macro manipulates the AST in a way that produces valid code. Check out the resources in the author docs. Good luck!
@kentcdodds this might be a bug
I'm able to do import { macro } from "./somename.macro"
But import macro from "./somename.macro"
doesn't work
Even in my macros file, I have export default createMacro(myMacro);
create-react-app macro
Open this
macro
project.Create a file
convert.macro.js
module.exports = createMacro(convert);
function convert({ references, state, babel }) { console.log(references); }
yarn start
In the browser, see the error: