Skip to content
This repository has been archived by the owner on Apr 21, 2022. It is now read-only.

[@pika/plugin-build-types] dist-types are not build with incremental tsconfig #117

Open
vadistic opened this issue Apr 7, 2020 · 0 comments

Comments

@vadistic
Copy link

vadistic commented Apr 7, 2020

Hello,

Issue:

Using @pika/plugin-build-types dist-types is not generated if incremental setting is true and *.tsBuildInfo file is present.

This results in easy to miss problem - I've found out about this after I've published package without typings :)

Right now there are two options:

// package.json
 // disable incremental in plugin options
      ...
      [
        "@pika/plugin-build-types",
        {
          "tsconfig": "./tsconfig.build.json",
          "args": ["--incremental", "false"]
        }
      ],
     ...
// tsconfig.build.json
// disable incremental in tsconfig.build.json
{
  "extends": "./tsconfig.json",
  "compilerOptions": {
    "incremental": false
  },
}

Which is quite fine if you know about it, but I think @pika/pack is about being noconfig/user-friendly and it could be improved by eliminating this issue.

Proposals about how to address it:

  1. Forcefully override incremental setting (by adding additional flag to tsc in exaca)
  • it provides sane default
  • it still allows user to override this setting in "args" option because tsc -p tsconfig.build.json --incremental true --incremental false works as expected with tsc compiler
  • add info about this to readme
  1. Read tsconfig and emit warning if incremental option is set true
  • less invasive, self documenting
  • can be also easily implemented because plugin resolves tsconfig path

I would suggest approach 1.

It's a 10 minute PR, but I would like to know if anoyone else share my opinion on this and which of the two proposed approaches (or maybe some other one?) would be more in line with this project philosophy 😄

@vadistic vadistic changed the title [@pika/plugin-build-types] dist-types are not build with incremental ts-config [@pika/plugin-build-types] dist-types are not build with incremental tsconfig Apr 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant