Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to handle nests macro #173

Open
s97712 opened this issue Apr 20, 2021 · 2 comments
Open

How to handle nests macro #173

s97712 opened this issue Apr 20, 2021 · 2 comments

Comments

@s97712
Copy link

s97712 commented Apr 20, 2021

  • babel-plugin-macros version:
  • node version:
  • npm version:

Relevant code or config

macro1(macro2("1 + 1"))

How to process macro2 first and then macro1
I try to adjust import order, but macro1 is always processed first.

@kentcdodds
Copy link
Owner

I believe they should run in the order they are imported in the file

@conartist6
Copy link
Collaborator

I believe that happens since the macro code is called in the visitor for each import/require declaration.

Would you mind sharing your real use case? babel-plugin-macros has never supported that pattern very well but so far most people don't seem to be running into the limitation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants