-
-
Notifications
You must be signed in to change notification settings - Fork 591
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 ~ Project References #1036
Comments
Note: This is not hooking into the plugin's resolveId's so any files built by the builder here is not being added to the overall rollup stack. It's also causing files to move around as it's following the tsconfig.json settings over the rollup settings. |
Following it, as i face the same problem inside my project |
@github-maxime-liege I have just written a rough prototype for rollup working with references. It's not yet on NPM as it's quite raw and I want to have some time to get a feel for how it works in our production environment, but feel free to take a look and provide input https://github.com/Kabe0/rollup-plugin-typescript-projects |
Hey folks. This issue hasn't received any traction for 60 days, so we're going to close this for housekeeping. If this is still an ongoing issue, please do consider contributing a Pull Request to resolve it. Further discussion is always welcome even with the issue closed. If anything actionable is posted in the comments, we'll consider reopening it. ⓘ |
@Kabe0, I see that you have continued working on this in your private repository. Any chances of getting this into a PR and back into rollup? Can I help? |
@oxc I have not yet handled the build metadata files which will be needed for it to be fast. It also has some memory issues at this time. If you have any questions about some code let me know. I might be able to spend some time to assist, but I have been pretty swamped lately. What I wrote though has been working in a project we have been using for quite some time so it is a good proof of concept. |
Feature Use Case
Project References
https://www.typescriptlang.org/docs/handbook/project-references.html
The current version of the TypeScript plugin has no awareness of the multiple-project configuration that can be setup with a tsconfig file. This will result in errors such as
Plugin typescript: @rollup/plugin-typescript TS6305: Output file '....d.ts' has not been built from source file '....ts'
Feature Proposal
Provide a toggle flag inside the typescript plugin, or detect when references is set. If set, load reference project files first before building out the main project.
ts-loader in https://github.com/TypeStrong/ts-loader/blob/47e374bab698676c62d09d515580f4c847ea157a/src/instances.ts already has a good example of this on line 489 -> buildSolutionReferences.
The command from the API is ts.createSolutionBuilder which requires a SolutionBuilderHost object as detailed here microsoft/TypeScript#31432. Then once created, the builder.build(); function is called to generate the necessary files.
I have created a very rough prototype of the function I am using for my own local project. Please take a look below...
Changed the watchProgram.ts from line 146 with the following modification
Putting it in createWatchHost is a bit weird, but it had all the variables ready so made it a bit easier to integrate. It is very rough, but it does work and build the modules as expected...
The text was updated successfully, but these errors were encountered: