teambit / envs

Component development environments for the Bit community
https://bit.dev/bit/envs
Other
63 stars 9 forks source link

React typescript - does not merge compiler options from overrides on workspace configuration #96

Open Tallyb opened 4 years ago

Tallyb commented 4 years ago

Assuming you imported a component that has a configuration in its pacakge.json similar to this:

  "bit": {
    "env": {
      "compiler": {
        "bit.envs/compilers/react-typescript@3.1.13": {
          "rawConfig": {
            "tsconfig": {
              "compilerOptions": {
                "lib": [
                  "dom",
                  "es2015"
                ],
                "jsx": "react"
              },
              "include": [
                "./**/*"
              ]
            }
        }
      }, 

If you are modifying the compiler configuration on the workspace package.json to include:

  "bit": {
    "env": {
      "compiler": {
        "bit.envs/compilers/react-typescript": {
          "rawConfig": {
            "tsconfig": {
              "compilerOptions": {
                "target": "ES5",
                "module": "CommonJS"
              }
            }
          }
        }
      },

or even if doing it in the overrides section for all components. The compilerOptions for target and module are being ignored when building the component.

It is not clear if this is a compiler bug or a bit bug that does not send the additional properties.