Add URL rewrites in webpack-dev-server
This commit is contained in:
@@ -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())
|
||||||
|
|||||||
Reference in New Issue
Block a user