nameof-ts5.macro
Setup
- Install dependencies:
npm install --save-dev babel-plugin-macros nameof-ts5.macro
-
Ensure
babel-plugin-macros
is properly setup (Instructions). -
Import and use the default export. For example:
import nameof from "nameof-ts5.macro";
nameof(window.alert);
Transforms to:
"alert";