Skip to content

Commit db81cde

Browse files
Merge pull request #1096 from smalruby/fix/admin-devserver-fallback
fix(admin): dev server で /admin もSPAにフォールバック
2 parents 684d9b4 + eabf84e commit db81cde

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

packages/admin/webpack.config.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@ module.exports = {
4848
],
4949
devServer: {
5050
port: process.env.PORT || 8602,
51-
historyApiFallback: true
51+
// Rewrite unknown paths (including the slashless /admin) to the SPA
52+
// index, which lives under publicPath — GitHub Pages does the
53+
// trailing-slash redirect in production, the dev server does not.
54+
historyApiFallback: {index: '/admin/'}
5255
},
5356
devtool: process.env.NODE_ENV === 'production' ? false : 'cheap-module-source-map'
5457
};

0 commit comments

Comments
 (0)