Created by: plievone
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
to index2.js
with modifications and seeing that both yarn start
and yarn build
succeeded and both http://localhost:3000/
and http://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
or src/pages/indexname.js
) to separate subdirectories (such as build/indexname/index.html
), but that may necessitate larger changes in build scripts than this minimal diff.