Wrong output_dir with create-react-app
By default CRA uses build folder for production build. Buildpack detection works wrong and set public folder as output_dir. But it should be dist. This static site used as a component for web service.
How can Buildpack detect correctly output_dir? Maybe there are some build commands? Thanks.
visual-builder-ui | 11:28:03 => Static site output directory is not explicitly set, attempting to look for static files
visual-builder-ui | 11:28:03 Checking /workspace/_static
visual-builder-ui | 11:28:03 Checking /workspace/dist
visual-builder-ui | 11:28:03 Checking /workspace/public
visual-builder-ui | 11:28:03 => Using document root /workspace/public
I tried to add react-app-rewired build && mv build _static but still no luck.
Ohh, looks like I started from html project and then add CRA to the repo. In this case this will miss "yarn build" custom build command. After removing component and adding it again it works fine :)
:wave: @sellpixels-robot
Sorry for the late response. Glad you could figure it out. We recently deployed an update to the output_dir detection process that should address use cases like this.
If auto detection gets it wrong you can manually set the output_dir option on the static site's spec and applying the change using doctl—see the spec reference.
Also, please post any questions or issues you run into on the DigitalOcean Q&A. The team closely monitors that and you should get a much quicker response than here 😄