Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface EnvFunction

Since NODE_ENV is a fairly common way to toggle behavior, Babel also includes an API function meant specifically for that. This API is used as a quick way to check the "envName" that Babel was loaded with, which takes NODE_ENV into account if no other overriding environment is set.

see

https://babeljs.io/docs/en/next/config-files#apienv

Hierarchy

  • EnvFunction

Callable

  • __call(): string
  • __call(envName: string | ReadonlyArray<string>): boolean
  • __call<T>(envCallback: (envName: NonNullable<TransformOptions["envName"]>) => T): T
  • Since NODE_ENV is a fairly common way to toggle behavior, Babel also includes an API function meant specifically for that. This API is used as a quick way to check the "envName" that Babel was loaded with, which takes NODE_ENV into account if no other overriding environment is set.

    Returns string

    the current envName string

  • Since NODE_ENV is a fairly common way to toggle behavior, Babel also includes an API function meant specifically for that. This API is used as a quick way to check the "envName" that Babel was loaded with, which takes NODE_ENV into account if no other overriding environment is set.

    Parameters

    Returns boolean

    true if the envName is === any of the given strings

  • Since NODE_ENV is a fairly common way to toggle behavior, Babel also includes an API function meant specifically for that. This API is used as a quick way to check the "envName" that Babel was loaded with, which takes NODE_ENV into account if no other overriding environment is set.

    Type parameters

    Parameters

    • envCallback: (envName: NonNullable<TransformOptions["envName"]>) => T
        • (envName: NonNullable<TransformOptions["envName"]>): T
        • Parameters

          Returns T

    Returns T