Multicompilation of indexXX.js files to indexXX.html outputs #2520
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.
Hi, consider this as a WIP / discussion opener / proof-of-concept of sorts related to #1084.
With this, it is quite easy to add multiple .html outputs when needed:
src/index.js
results inindex.html
and accompanied bundles inbuild/
src/indexXX.js
results inindexXX.html
and accompanied bundles inbuild/
Verified by copying
packages/react-scripts/template/src/index.js
toindex2.js
with modifications and seeing that bothyarn start
andyarn build
succeeded and bothhttp://localhost:3000/
andhttp://localhost:3000/index2.html
work and hot-reload ok, but there may well be edge cases (such as advanced configuration and router usage) so please don't merge until polished by a knowledgeable create-react-app person.It might be better to output pages (such as
src/pages/indexname/index.js
orsrc/pages/indexname.js
) to separate subdirectories (such asbuild/indexname/index.html
), but that may necessitate larger changes in build scripts than this minimal diff.