Skip to main content

Module flags

Module flags 

Source
Expand description

Feature flag detection via lightweight Oxc AST visitor.

Detects three patterns:

  1. Environment variables: process.env.FEATURE_X, import.meta.env.VITE_FEATURE_X
  2. SDK calls: useFlag('name'), variation('name', false), flag({ key: 'name' }), etc.
  3. Config objects: config.features.x (opt-in, heuristic)

Always extracted during parse (lightweight pattern matching on MemberExpression and CallExpression nodes). Custom SDK patterns, env prefixes, and config object heuristics from the flags config section apply in the same pass.

Functionsยง

builtin_env_prefixes
Built-in environment variable prefixes treated as feature flags.
builtin_sdk_providers
Distinct built-in SDK provider labels, in declaration order.