Skip to content

include in tsconfigDefaults is overridden by index from original tsconfig.json #226

Closed
@kioviensis

Description

@kioviensis

What happens and why it is wrong

That bug is really weird.
At some point, I started getting a weird error caused by include option of typescript2 config and project tsconfig.json.
I even stopped understanding how it works, does it override or concatenate, or what?
then, I decided that I need to debug this array to check what finally gets there

My rollup-plugin-typescript2 config:

  typescript2({
      clean: true,
      tsconfigDefaults: {
        ....
        include: [path.resolve(__dirname, 'styles.d.ts')],
      }
    }),

My tsconfig.json config:

   ...
  "include": ["src", "declaration.d.ts"]
}

The result is
Screenshot 2020-05-07 at 19 44 57

As I said before, I started debugging this it gives some kind of awkward result every time.
In fact, it does not concatenate these properties, but replaces the values in the index cell, which simply takes by surprise and worsens developer experience.

What I mean:
it takes 0 the index of the array of my tsconfig and puts it instead of the value under the 0 index of typescript2 config.

Example 1:

typescript2: ['a']
tsconfig: ['b', 'c']
result: ['b', 'c']

Example 2:

typescript2: ['a', 'd']
tsconfig: ['b', 'c']
result: ['b', 'c']

Example 3:

typescript2: ['a', 'd', 'e']
tsconfig: ['b', 'c']
result: ['b', 'c', 'e']

It is completely annoying

Environment

I'm not sure this is relevant, but
Node: 13.13.0
OS: macOS Catalina 10.15.4

Versions

  • typescript: 3.8.3
  • rollup: 2.8.1
  • rollup-plugin-typescript2: 0.27.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    abusiveContains abusive contentkind: bugSomething isn't working properlysolution: duplicateThis issue or pull request already existssolution: workaround availableThere is a workaround available for this issue

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions