Assuming you are using create-react-app changing your package.json like this and rebuilding should work:
"build": "PUBLIC_URL=/wp-content/reactpress/apps/[appname]/build react-scripts build",
Thank you rockiger! It’s a great plugin, I just got it to work! Very excited!
Another question, during development I used a slug name. I deleted the app and rebuilt the app directory, but when I try to reuse the slug name, it says:
“There exists another page that already has this page slug.”
How can I refresh this so that the slug is available to use again?
ReactPress creates a page in your WP, you will need to delete this page to reuse the same slug.
I am glad that ReactPress could help you. I am always happy about a nice review 🙂
Okay, so I deleted the page and I also deleted it from the trash – but I still can’t use the same slug name. Any other idea where I can check?
Maybe delete the app and try again. Otherwise, I don’t have any idea.
I can’t figure this out either. I deleted it and reinstalled it a few times. Removed the reactpress directory. I even searched for the slug name with phpmyadmin and no record of the slug name, and it still doesn’t let me reuse.
Did you delete the app only on the harddrive? If yes, the options array wasn’t changed properly.
Uninstall ReactPress and install it again, then it should work like expected again. Careful, all settings for ReactPress will be deleted.
I will need to add a feature for cleaning of the settings array in the future.
I was able to reuse the slug after a few uninstall/deactivation/deletes maybe it was a cache problem for me.
I’m using a bitnami wordpress package. When I add this:
“build”: “PUBLIC_URL=/wp-content/reactpress/apps/[appname]/build react-scripts build”,
I can see it working on site.com/wp-content/reactpress/apps/appname/build but it doesn’t work on site.com/slug
Any ideas what I missed?
Did you replace [appname] with the name of your app?