babel-plugin-macros icon indicating copy to clipboard operation
babel-plugin-macros copied to clipboard

How to handle nests macro

Open s97712 opened this issue 4 years ago • 2 comments

  • 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.

s97712 avatar Apr 20 '21 07:04 s97712

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

kentcdodds avatar Apr 20 '21 13:04 kentcdodds

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.

conartist6 avatar Apr 20 '21 13:04 conartist6