-
Notifications
You must be signed in to change notification settings - Fork 12.8k
after compile .d.ts files will not be included in build (outDir) folder #5112
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
Comments
The .d.ts files you use are an input to the build system but not an output. It's perfectly reasonable to consume some types from a .d.ts but have your output not use those types, so there'd be no reason to distribute the input .d.ts with your build results. It sounds like you'll want a post-build step in your build tool to copy the relevant .d.ts files wherever you need them. |
@danquirk , thank you for your answer! I have in serverModels.d.ts declarations of server models. In my projects i use this declarations for checking translation from client models to server models. |
@danquirk, @RyanCavanaugh, @basarat, Can you help me to solve my problem? Or maybe I should provide you repo with example? |
The .d.ts files are considered "references" the compiler will not touch them, not move them, or recreate them. the only thing it will do, if you have a |
what he said ^ There are reasons why I feel this is good ... e.g. one would not want |
Thank you! |
Is there a workaround to include custom typings files? For instance I have a custom main.d.ts file with interfaces:
I have a main file index.ts which is refered in the package.json file:
if I add to it tripple slash references the generated d.ts file for it will change it references to refer to the source. How can I include the custom d.ts files and still have the correct references (without manually changing the generated files and without manually dragging and dropping custom d.ts files. |
Add the file in your tsconfig.json in the "include" section. |
No, it is not being included. I have read the documentation and read all the responses on github and stackoverflow concerning this topic, if I specify only the d.ts file nothing gets compiled, if I specify both files (the main entry point file and the d.ts file) it compiles, but still the d.ts file is not included. Update: Found a way around. |
@vsarunov If you found a way around please publish it here for others to find. |
When |
Hello.
i have typescript project.
it contains autogenerated from .net interfaces.
file has .d.ts extension and contains in tsconfig.json
after compile in outDir i have js, d.ts for my source but i havnt autogenerated.d.ts
Why d.ts is not included in compilation result?
I think, each d.ts files should be included in outDir according project sources tree
The text was updated successfully, but these errors were encountered: