Adding history support

Arriving on a new map now changes the URL.
All URLs starting with _ are automatically redirected to index.html by the web server
This commit is contained in:
David Négrier 2020-05-12 00:07:50 +02:00
parent 9417e4a4d2
commit daa559738b
4 changed files with 40 additions and 0 deletions

View file

@ -8,6 +8,12 @@ module.exports = {
contentBase: './dist',
host: '0.0.0.0',
disableHostCheck: true,
historyApiFallback: {
rewrites: [
{ from: /^_\/.*$/, to: '/index.html' }
],
disableDotRule: true
},
},
module: {
rules: [
@ -24,6 +30,7 @@ module.exports = {
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist'),
publicPath: '/'
},
plugins: [
new webpack.ProvidePlugin({