Skip to content

[Request] - Mention a plugin interaction #117

@MrcSnm

Description

@MrcSnm

Hello!
I've made some plugin for webpack that generates a C-Like macro. So, I've been using this plugin with ts-nameof, and it has a great relationship with this plugin.

For instance, I could define a new macro called _LOG: which would log the variable name with its value

DEFINE(_LOG, (v) =>
{
console.log(nameof(v) + " = ", v);
});
When this function is called anywhere, the output code would be the filename where this function is called, every compile time feature has much to gain from that as it is a simple text replace tool.

//index.ts

let myName = "Test";

_LOG(myName); //myName = "Test"

By using macro functions, no variable name is lost at the function call, which makes a perfect candidate to use together with the nameof plugin
Hope you take a look and we could work in some more interactions for define_macro-loader

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