Skip to content

Commit 77f818f

Browse files
committed
Ensure page reloads in history mode serve index.html
After the switch to CopyWebpackPlugin (#1176), historyAPIFallback had to be adjusted to still serve index.html from all catched paths correctly. See: vuejs-templates/webpack#1176 (comment)
1 parent 8999806 commit 77f818f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

template/build/webpack.dev.conf.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ const devWebpackConfig = merge(baseWebpackConfig, {
2323
// these devServer options should be customized in /config/index.js
2424
devServer: {
2525
clientLogLevel: 'warning',
26-
historyApiFallback: true,
26+
historyApiFallback: {
27+
rewrites: [
28+
{ from: /.*/, to: path.join(config.dev.assetsPublicPath, 'index.html') },
29+
],
30+
},
2731
hot: true,
2832
contentBase: false, // since we use CopyWebpackPlugin.
2933
compress: true,

0 commit comments

Comments
 (0)