How to tell webpack dev server to serve index.html for any route

后端 未结 10 2071
心在旅途
心在旅途 2020-11-28 22:00

React router allows react apps to handle /arbitrary/route. In order this to work, I need my server to send the React app on any matched route.

But webpa

10条回答
  •  爱一瞬间的悲伤
    2020-11-28 22:25

    Works for me like this

    devServer: {
        contentBase: "./src",
        hot: true,
        port: 3000,
        historyApiFallback: true
    
    },
    

    Working on riot app

提交回复
热议问题