support for custom tsconfig through TSCONFIG_PROD and TSCONFIG_DEV#11031
Conversation
|
Hi @CarlRibbegaardh! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks! |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
|
Hi @CarlRibbegaardh, I think I understand the issue you want to resolve here. Could you provide some more details about how your monorepo works with CRA? I assume that all of these packages have independent build processes? Also, if we do move forward with this, I think the appropriate names would be |
The current solution I'm working at has 2 prior libraries that is simply ts compiled. It has one recently added library using rollup which was created using the cra typescript as a template and then modified to use rollup. It has two frontend apps using cra 4 typescript template. The two first libraries core and components is compiled using tsc to a build folder. The foundation library using rollup compiles to a dist folder. The frontends have dependencies to the libraries. In order to have multiple configs, we've been editing them on the fly and restoring them. But ever so often the config files are changed and we need to revert them before committing. It's a troublesome procedure. I have a temporary npm package here with some more documentation: |
I've gone through all changes and updated so that dev and prod are the terms used throughout the feature. |
|
@mrmckeb I hope you have seen the details and changes provided so far. Does it paint a clear picture or am I too vague? |
|
@ianschmitz @iansu @petetnt Any chance of any feedback or discussion of this PR? I'm not that used to github so I'm sorry if there's a better way to connect that I should have used. |
|
@mrmckeb @ianschmitz @iansu @petetnt
It would help a lot with a way to point to a tsconfig. :) |
|
Bumping again, hoping for feedback. |
|
This pull request has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs. |
|
Hey there, I know this is stale but this sort of feature is desirable. And the proposal would go along a ways. As mentionned in #6023 (comment)
Thanks guys :) |
5e17ff6 to
f34d88e
Compare
|
What happened here? I synchronized the current master to my repo and then suddenly something happens here? Not good. |
|
@CarlRibbegaardh it seems that you've somehow force-pushed |
|
That's ok. I was afraid I managed to force push things to facebook:master. Thanks for checking! |
|
@CarlRibbegaardh but didn't you previously suggest some changes in this PR, that have then been lost? or is |
|
@fabien-somnier |
|
@fabien-somnier @MartinHarkins @mrmckeb @ianschmitz @iansu @petetnt @grandsilence @vicrep @TomaszG @dylnclrk @jboler |
I've added 2 environment variables. TSCONFIG_BUILD and TSCONFIG_WATCH.
They are used for setting a custom tsconfig in a monorepo setting.
The reason for this is when a tsconfig.json inherits a base tsconfig with all interrnal package folders defined in order to facilitate easy navigation from the outermost projects into components inside library projects, it causes the build process to navigate through the source files instead of the build/dist folders of the library project builds. This is usually solved by updating the tsconfig on the fly before
react-scripts buildor copying between build and edit mode configs.I've used env-cmd with the following setting for building.