How to use Custom Macro?

I am using Creator 3.4.1
I see adding Custom Macro option inside Project Settings.

  1. May i know how to use in TS?
  2. Also if its not selected then those code will be avoided at compile-time?
import * as custom_macro from "cc/userland/macro";
if (custom_macro.DEFINED_MACRO) {
	// TODO
}
2 Likes

@runzelin Thanks for reply.
but about my second question

if its simple if/else that means it wont removed at compile time, right?

you right. it won’t removed at compile time. enable or disable the macro before compile.