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..
I had to do something similar recently in order to get a react app running in a sub directory. Try the below and see how you get on.
import React from 'react';
import { Router, Route, IndexRoute, useRouterHistory } from 'react-router';
import { createHistory } from 'history';
import VensaDashboard from './components/VensaDashboard';
import Inbox from './components/Inbox';
import Todo from './components/Todo';
import Home from './components/Home';
// specify basename below if running in a subdirectory or set as "/" if app runs in root
const appHistory = useRouterHistory(createHistory)({
basename: "/vensa"
});
export default (
);
You may also have to update the path to your bundle.js file in index.html as shown below
Vensa Development Test