I am looking to dynamically remove specific enum properties based on the environment.
For example, in the build environment, I require all the enums:
export enum ERROR_TYPE {
InvalidComponent = 'invalid_component',
ForOnPrimitiveOrNull = "for_on_primitive|null",
InvalidEventHandler = "invalid_event_handler",
InvalidFormatter = "invalid_formatter",
PropDataTypeMismatch = "prop_data_type_mismatch",
RendererNotFound = "createRenderer_not_found",
MutatingProp = "mutating_prop",
SetSameValue = "set_same_value"
}
However, for the production environment, I only need a subset of the enum properties:
export enum ERROR_TYPE {
InvalidComponent = 'invalid_component',
ForOnPrimitiveOrNull = "for_on_primitive|null",
InvalidEventHandler = "invalid_event_handler",
InvalidFormatter = "invalid_formatter",
}
Is there a way to achieve this? If not, what is the recommended approach or alternative solution?
I want to exclude these unnecessary codes from the bundle size as they are not used in the production environment.