I have a React app I\'ve been developing on my localhost. I want to copy it to a server into a subdirectory called vensa.
My webpack config file looks like this..
In my situation, I needed to support a scenario, where there might be 0 to many subfolders with unknown names and production uses only static files.
In my App.js, I defined this simple function:
const getBasename = path => path.substr(0, path.lastIndexOf('/'));
Which I use to define the basename:
This works with no subfolder as well as many subfolders and it can manage reloads as well.