I have a React App that does not have an index.html page. My very first react app so please consider my level of expertise.
There are many answers here but not when there is no index html entry point.
I am running this app already successfully on apache on XAMPP for development on localhost:7000 (no index.html). This works fine because my webpack loads a bundle js in memory. I use the command "server": "node app.js", to run the hot loaded local server.
Here is a part of my webpack config.
module.exports = {
entry: './src/main.js',
output: {
path: join(__dirname, '/dist/js/'),
filename: 'bundle.js',
publicPath: '/',
},
What I have so far:
- I have configured webpack to write a single bundle js file into my dist/js folder
- I have all images stored in dist/images folder
- I added all above folders and bundle js into root of XAMPP (htdocs) folder.
Here is my directory structure that worked for Dev:
config
dist
node_modules
routes (contains all routes for the App)
src (Has all components and entry is main.js)
styles (Has scss but it gets compiled into a single dist/styles/style.css)
views (Has all handle bar files for views)
-app.js (Main entry with express and webpack config references)
-app-routes (routes for the app)
-env,js(Has environment variables such as database connection details, port)
-webpack.config.js
-nodemon.json
-package.json
After yarn run prod, I get a dist folder as below
images (all images for app)
js (contains bundle.js file)
styles (contains compiled style.css)
What files should I add to htdocs root folder?