Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

watch additional files #41224

Open
5 tasks done
xenoterracide opened this issue Oct 24, 2020 · 2 comments
Open
5 tasks done

watch additional files #41224

xenoterracide opened this issue Oct 24, 2020 · 2 comments
Labels
Awaiting More Feedback This means we'd like to hear from more people who would be helped by this feature Suggestion An idea for TypeScript

Comments

@xenoterracide
Copy link

xenoterracide commented Oct 24, 2020

Search Terms

tsc watch yarn.lock

Suggestion

add the ability to watch files that are not part of the default set

Use Cases

primary use case for this is to auto restart language server, or a tsc --watch if yarn.lock changes when using pnp since there is no node_modules to watch. currently if a library is removed tsc will actually crash when it goes missing. When a library is added tsc watch needs to be manually restarted.

Examples

I think these should be additive, not replace the existing paths, however I can see adding a new option for additivity, or requiring this to replace existing options. If it replaces the current watch set then it should be well documented how to specify them. If no arguments are provided the behavior of suggested would be use the defaults.

tsc --watch yarn.lock

"compilerOptions": {
    "watch": {
      "paths": ["yarn.lock"],
    },
}

Checklist

My suggestion meets these guidelines:

  • This wouldn't be a breaking change in existing TypeScript/JavaScript code
  • This wouldn't change the runtime behavior of existing JavaScript code
  • This could be implemented without emitting different JS based on the types of the expressions
  • This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, etc.)
  • This feature would agree with the rest of TypeScript's Design Goals.
@MartinJohns
Copy link
Contributor

when using pnp

Related: #28289

@RyanCavanaugh RyanCavanaugh added Awaiting More Feedback This means we'd like to hear from more people who would be helped by this feature Suggestion An idea for TypeScript labels Nov 4, 2020
@ryan-williams
Copy link

I have a "bin" script in the top level of my project. I use tsc -w to build continuously (into dist/) while developing, and npm link to test downstream projects that use the bin script, but haven't found a way for tsc -w to continuously mirror my bin script into dist/.

afaict that's what this issue refers to, so mentioning my use case; perhaps there is a way, or workaround, for future searchers?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting More Feedback This means we'd like to hear from more people who would be helped by this feature Suggestion An idea for TypeScript
Projects
None yet
Development

No branches or pull requests

4 participants