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

[@pika/plugin-ts-standard-pkg] Handle "incremental: true" #68

Open
oBusk opened this issue Jul 13, 2019 · 3 comments
Open

[@pika/plugin-ts-standard-pkg] Handle "incremental: true" #68

oBusk opened this issue Jul 13, 2019 · 3 comments

Comments

@oBusk
Copy link
Contributor

oBusk commented Jul 13, 2019

There are problems when/if incremental: true in the used tsconfig.json.

  • The .tsbuildinfo is outputted into dist-src
  • If tsBuildInfoFile is set, incremental builds will fail with Error: "dist-src/" does not exist, or was not yet created in the pipeline.
    1. Set incremental: true and tsBuildInfoFile: '.cache/.tsbuildinfo'
    2. pack build should succeed
    3. Running pack build any time after will fail, until you delete .cache

I don't know if there is any gain in trying to support incremental: true or if the plugin should just console.error() or force the setting to false.

@FredKSchott
Copy link
Owner

FredKSchott commented Jul 15, 2019

This is a great idea, but unfortunately right now we clear the pkg/ directory every time we build. To solve we would need to either:

  1. allow plugins/users to configure whether the pkg/ directory is cleared on re-build
  2. create the "watch" mode that we've always talked about, and enable this here

I'm leaning towards # 2, at least since this isn't the first time that has been asked for

@oBusk
Copy link
Contributor Author

oBusk commented Jul 16, 2019

@FredKSchott I'm not sure what "watch mode" would be for personally, but if people are asking for it, then yea, making use of the performance gain of incremental: true would be very nice.
But since you can store the cache tsBuildInfoFile to any other directory, keeping pkg wouldn't necessarily be required. Like i wrote, the build seems to go through (no error), but no new file is outputed into pkg/dist-src.

@oBusk
Copy link
Contributor Author

oBusk commented Jul 16, 2019

@FredKSchott So without knowing how any watch mode would work, the fix would either be to override the incremental setting in the builder, or alert the user to disable the setting.

Obviously overriding the setting would be the better solution, like this (https://github.com/oBusk/builders/commit/2e4dbf49f9f9e7842003de6bd2395d7f050912ed), but the problem with that, is that there is no way to "unset" the tsBuildInfoFile setting as a CLI argument, so if you've defined it in the tsconfig.json, you'll alwyas get a printed error;

error TS5069: Option 'tsBuildInfoFile' cannot be specified without specifying option 'incremental' or option 'composite'.

So the other option would be to add warning for it, so the user is aware why the build isn't working, would look something like this; https://github.com/oBusk/builders/commit/64b26dfcf8ab95c3ef28fef76069fce557a787ce

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

2 participants