Add URL rewrites in webpack-dev-server

This commit is contained in:
Daniel Vassallo
2019-10-24 22:36:00 -07:00
parent ff2579adfa
commit a3dc0be30d

View File

@@ -93,12 +93,20 @@ module.exports = (env, argv) => {
config.devServer = {
watchContentBase: true,
historyApiFallback: true,
hot: true,
inline: true,
host: '0.0.0.0',
port: 3000
port: 3000,
historyApiFallback: {
rewrites: [
{
from: /^\/.*$/,
to: function (context) {
return '/' + context.parsedUrl.pathname + '.html';
}
}
]
}
}
config.plugins.push(new webpack.HotModuleReplacementPlugin())