static server dev build #10550
              
                Unanswered
              
          
                  
                    
                      pschaubroeck
                    
                  
                
                  asked this question in
                Q&A
              
            Replies: 0 comments
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
-
When hosting an app bootstrapped with create-react-app that will be served up on a static server, production build work as expected. When providing a PUBLIC_URL to
react-script build, it generates absolute urls. When doing the same thing forreact-scripts startit always makes urls relative. Have attempted the same/similar thing with hostname with no success.Offending code forcing relative urls is in
react-dev-utils/getPublicUrlOrPath.js. I'm just not seeing any way around it at the moment.I would love to provide a development experience that more closely resembles how this will actually work in production, while retaining things like development prop-type checks.
Is there any known way to accomplish this?
https://create-react-app.dev/docs/deployment#static-server
Beta Was this translation helpful? Give feedback.
All reactions