You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is quite common to need to have webpack bundle an app such that the index.html is in the parent directory which contains a subdirectory for the rest of the assets, such as the following directory structure:
This works fine for production builds, but in development mode, webpack-dev-server fails to find the index.html file and all requests to the server result in 404 responses.
Actual Behavior / Situation
After much experimentation, I was able to modify the webpack.config.js to get the index.html serving properly like this:
I recommend do not have index.html in root at all, due to this you need workaround, I don't think we can fix it without breaking change and it will break other cases
Modification Proposal
Expected Behavior / Situation
It is quite common to need to have webpack bundle an app such that the index.html is in the parent directory which contains a subdirectory for the rest of the assets, such as the following directory structure:
/index.html
/static/app-bundle.js
/static/app-bundle.css
The
webpack.config.js
for the above looks like this:This works fine for production builds, but in development mode, webpack-dev-server fails to find the
index.html
file and all requests to the server result in404
responses.Actual Behavior / Situation
After much experimentation, I was able to modify the
webpack.config.js
to get theindex.html
serving properly like this:It would be really nice if
historyApiFallback: true
did the logical thing for this case, without requiring the following workaround:Please paste the results of
npx webpack-cli info
here, and mention other relevant informationThe text was updated successfully, but these errors were encountered: