Browse Source

fixed history path bug in dev server
using historyApiFallback
based on https://github.com/vuejs-templates/webpack/blob/develop/template/config/index.js

Bachir Soussi Chiadmi 4 years ago
parent
commit
07f35b0e89
1 changed files with 6 additions and 0 deletions
  1. 6 0
      build/webpack.config.dev.js

+ 6 - 0
build/webpack.config.dev.js

@@ -2,6 +2,7 @@
 
 const webpack = require('webpack')
 const merge = require('webpack-merge')
+
 const baseConfig = require('./webpack.config.base')
 
 const PORT = 8988
@@ -11,6 +12,11 @@ module.exports = merge(baseConfig, {
 
   devServer: {
     clientLogLevel: 'warning',
+    historyApiFallback: {
+      rewrites: [
+        { from: /.*/, to: '/index.html' },
+      ],
+    },
     hot: true,
     contentBase: 'dist',
     compress: true,