Setup a flag to enable writeToDisk in dev mode #7812
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
About
This PR sets up a flag to enable writing build-files to disk in development mode. As requested by issue #1070. This is quite helpful when using CRA with backends that are not written in JS, when making chrome extensions and when integrating React to a legacy UI system(eg: A UI written in PHP and react components injected in client-side).
These changes are live in a production app (made possible using the npm patch-package module). I believe it makes more sense to make it a built-in feature of CRA.
How to verify changes
react-scripts start --writeToDisk
.Documentation and Tests
No tests or docs have been written yet. Happy to make the PR more complete once I get the approval from the maintainers/community.
Disclaimer
This is my 1st PR to CRA. So I apologize if I have made a mistake in the contribution procedure.