Skip to content

How does it actually work ? #7

@MarcWeber

Description

@MarcWeber

I love macros, too.
I hacked my own solution like this:

/* MACRO HERE blah */  /* MACRO END */

And writing a regex based preprocessor which fills in the code
So locations are correct, but I have all the verbose output in my files.
Some editors like Vim allow to collapse regions so ..

But would you mind explaining how your implementation works ?

If you want to use vite whatever .. who and when is responsible for doing the macro expansion ?
Environments ?
node, deno, esbuild, rollup, webpack, ....

But you made me think whether abusing providing own
implementation for 'import' would work, too.
But imports must be async or must be found at top of file.
So again no perfect solution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions