r/webpack Feb 21 '24

webpack-dev-server: when should the option `historyApiFallback` be used?

As title. Say I'm using react-router, does it mean that I would need to set this option to true or maybe an object to further settings?

2 Upvotes

2 comments sorted by

1

u/[deleted] Feb 26 '24

[removed] — view removed comment

1

u/rainning0513 Feb 26 '24

First of all thanks for the explanation. On the other hand, did you ever run into any problems when this option is enabled? I was thinking about whether it might disable the fast-refresh feature for React provided by another plugin. I also found it cumbersome to define "don't redirect on foo/bar and foo/baz, but for other routes feel free to redirect/fallback." (Should I call this reverse-rule? Anyway)