-
-
Notifications
You must be signed in to change notification settings - Fork 27k
How to add static pages? #1448
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
why not just use react-router? |
Because I don't want all assets delivered to "normal" users that are only associated with administrative users. |
It can be done with code splitting though. https://www.drewbolles.com/blog/2016/11/14/webpack-code-splitting-with-create-react-app-react-router/ |
So, is the answer that static pages outside of index.html are not supported? I don't have any "need" or want to start using React-Router at this point. Just playing around with create-react-app to see if it fits our business needs and would be a suggestible solution, and what cases fall outside when to suggest it. Naturally the Admin section could be built in a separate project and pull from common assets, in fact that would probably be the suggestion, this is just the first use case I could come up with off the top of my head. |
AFAIK the production build script only process one index.html (for assets url) from the public folder and generates hashed assets for that build, so for your use case I think it's best just to build a separate project for admin section or use react router. |
Building a separate page is not supported out of the box, sorry! You could implement this with code splitting, but it would mean Code splitting has no relation to React Router. You would need to use We’ll be changing how code splitting works (from |
so we can just conditionally |
Sure, you should be able to. |
Great! Thank you! |
Going to close as a duplicate of #1084. |
I couldn't find this in the documentation and am lost as to how exactly I should go about creating additional static pages/folders outside the default index.html
In my case I want to create a folder (admin/) that contains a different index.html file that contains a complete app that imports parts of the root app.
What is the right way of doing this?
The text was updated successfully, but these errors were encountered: