-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
TypeScript refuses to emit files from node_modules with getEmitOutput() #11946
Comments
Files coming from "node_modules" are considered "external", and are not emitted. you can see why writing output to you However, If the files are included in your compilation, they should be emitted. This does not seem to work correctly today, so we need to fix this. |
Just to clarify, this issue is tracking emitting node_module files iff they are listed in the "include" list in a tsconfig.json. |
@mhegazy I see several different use-cases here:
I'm not quite sure that adding I think the best solution for (2) is to allow to override the check somehow. |
The two code paths cannot produce different output. I understand this makes sense to your scenario but it sure will be odd that you run
Just to put things in prescriptive, we used to emit files in node_modules (as a result of a bug), and users have complained about this repeatedly. it is unexpected when compiling your code to change your dependencies. there are numerous packages out there that ship with their sources as well. and i would argue you need to know what files you are touching at any point of time, otherwise running npm install can include some package you did not know about, or give you errors in code you do not own. |
Outside I have a monorepo structured like boennemann/alle. It makes the monorepo very easy to work with, requiring minimal tooling. The trick is to place all code under Unfortunately I'm running into this issue... Now it's necessary to either omit Alternatively a configuration option in |
whats the status on this one? |
I also have the same mono repo structure as @jjrv and accidentally landed up in this issue from the reference in |
Hi. In out company we use workflow when all packages are written in pure TypeScript and we publish and consume them as-is, without any pre-compilation. I know that it's slower, but it's very convenient for developers, because they don't need to run several parallel
tsc --watch
processes.We used
webpack
andawesome-typescript-loader
for this and everything worked fine. But I see that now TypeScript refuses to emit files fromnode_modules
directory usinggetEmitOutput()
, because ofisSourceFileFromExternalLibrary
check here.Can we make this configurable?
The text was updated successfully, but these errors were encountered: