Interface: DefineDceVisitorConfig
Like define in various bundlers, but this one happens at transform time, and a DCE pass will be performed.
Properties
define
define:
Record<string,string>
Replaces variables in your code with other values or expressions at compile time.
Remarks
Caveat: differences between source.define
defineDCE happens before transforming background-only directives.
So it's useful for eliminating code that is only used in the background from main-thread.
Example
Then, __FOO__ and process.env.PLATFORM could be used in source code.