Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save itaymendel/0311269d65931c7e414bc360d9fe34d0 to your computer and use it in GitHub Desktop.
Save itaymendel/0311269d65931c7e414bc360d9fe34d0 to your computer and use it in GitHub Desktop.
envs overrides in a Bit workspace configuration

This snippet covers a few possible features and configuration.

  1. line 4 - define a default compiler for all tracked component. its possible to leave it empty.
  2. line 7 - override configurations for all component IDs that starts with "ui/".
  3. line 9 - define another compiler for "ui/*".
  4. line 12 - you can keep setting other rules to override other subset of components. for example - components starting with "utils/*"
  5. line 17 - can set a specific component ID to overrides.
  6. line 19 - use "-" to remove the compiler definition from component.
{
    "bit": {
        "env": {
            "compiler": "bit.envs/compilers/babel@7.0.0"
        },
        "overrides": {
            "ui/*": {
                "env": {
                    "compiler": "bit.envs/compilers/react@1.0.1"
                }
            },
            "utils/*": {
                "env": {
                    "compiler": "bit.envs/compilers/typescript@3.0.0"
                }
            },
            "utils/is-string": {
                "env": {
                    "compiler": "-"
                }
            }
        }
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment