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 = { config.devServer = {
watchContentBase: true, watchContentBase: true,
historyApiFallback: true,
hot: true, hot: true,
inline: true, inline: true,
host: '0.0.0.0', 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()) config.plugins.push(new webpack.HotModuleReplacementPlugin())