Skip to content

Conversation

@jiadesen
Copy link
Contributor

@jiadesen jiadesen commented Apr 7, 2023

#35

主要包含以下更改:

  1. 通过注入后置中间件的方式重写 configureServer
  2. 删除 useHistoryFallbackMiddleware 的默认规则

@emosheeep
Copy link
Owner

为啥把默认规则删了呀🤔

@jiadesen
Copy link
Contributor Author

jiadesen commented Apr 9, 2023

参照 connect-history-api-fallback 重写了 configureServer 的重定向策略,确实比较麻烦,但是应该能完全避免影响 rewritespages 配置之外的请求;configurePreviewServer 里的暂时没处理,如果也按 configureServer 重写的话 connect-history-api-fallback 这个依赖就可以干掉了

@jiadesen
Copy link
Contributor Author

jiadesen commented Apr 9, 2023

为啥把默认规则删了呀

没删,作为全局变量在这里声明:

image

在这里赋值:

image

在这里使用:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants