rollup-plugin-serve: historyApiFallback not working
Hi, thank you very much for this repo. I want to use the plugin for my new svelte spa app.
My config looks like this:
serve({
contentBase: 'dist',
port: 5000,
historyApiFallback: true
}),
But the historyApiFallback isn’t working. When i go to localhost:5000/solutions/technic i still get 404 Not Found and i don’t see the index.html
How can i solve this?
About this issue
- Original URL
- State: open
- Created 5 years ago
- Comments: 15 (4 by maintainers)
Could be interesting to make a repo so we can see what’s going wrong.
Does that mean you removed the leading forward slash? You have to add it, otherwise any request to a nested route like
http://example.com/lorem/ipsumwill try to load your script fromhttp://example.com/lorem/ipsum/dist/main.js, which is why it fails.There doesn’t seem to be anything wrong in your
rollup.config.jsfrom what I can tell.@UIX-Design do you have a leading forward slash in your
<script src="dist/bundle.js">onindex.html? If not, try to add it. I had the same issue and that fixed it.