Skip to content
This repository has been archived by the owner on Dec 6, 2021. It is now read-only.

Commit

Permalink
fix: With publicPath and historyApiFallback, manually set fallback in…
Browse files Browse the repository at this point in the history
…dex (#764)
  • Loading branch information
itsMapleLeaf authored Oct 25, 2020
1 parent cbb195b commit cf6279b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions core/poi/lib/plugins/serve.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,13 @@ exports.cli = api => {
}
)

if (devServerConfig.publicPath && devServerConfig.historyApiFallback) {
devServerConfig.historyApiFallback = {
index: `${devServerConfig.publicPath}/index.html`.replace(/\/+/, '/'),
...devServerConfig.historyApiFallback
}
}

const existingBefore = devServerConfig.before
devServerConfig.before = server => {
api.hooks.invoke('beforeDevMiddlewares', server)
Expand Down

0 comments on commit cf6279b

Please sign in to comment.