Don't assume the project is hosted at the root
See original GitHub issueWe currently have an assumption in publicPath
in webpack.config.prod.js
that the bundle is served from the root, but it may not be (e.g. with GH Pages, it’ll be at you.github.io/projectname/
).
I don’t want to add configuration for this but it would be great if we could parse homepage
from package.json
and use it to determine the publicPath
. We can then document it or add a prompt (or a notice) as part of the creation flow.
Issue Analytics
- State:
- Created 7 years ago
- Comments:13 (5 by maintainers)
Top Results From Across the Web
How should I configure create-react-app to serve app from ...
I want to server admin panel from https://smyapp.example.com/admin/. I try to use create-react-app but it assumes that i serve SPA from root URL ......
Read more >How to avoid $HOME being considered as project root by ...
Your $HOME is recognized as a project root Emacs will assume $HOME is the root of any project living under $HOME. If this...
Read more >How To Set Up a React Project with Create React App
Starting a new JavaScript project with React used to be a complicated ... The project was built assuming it is hosted at the...
Read more >Pitfalls and Common Mistakes | NGINX
Some directories in any file system should never be used for hosting data from. These include / and root . You should never...
Read more >2. Project Management Overview
Projects exist to bring about a product or service that hasn't existed before. In this sense, a project is unique. Unique means that...
Read more >Top Related Medium Post
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You can use my “todos” repo as good testbed. (Make sure to switch to branch with the biggest number.) Then play with opening /active or /completed and refreshing.
If this is done using any kind of config, it must be in such a way IMO that the publicPath should be accessible from the main code.