Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

refactor(plugin): configureServer use injecting post middleware #37

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jiadesen wants to merge 4 commits into emosheeep:master
base: master
Choose a base branch
Loading
from jiadesen:refactor_injecting_post_middleware_0407

Conversation

@jiadesen
Copy link
Contributor

@jiadesen jiadesen commented Apr 7, 2023
edited
Loading

#35

主要包含以下更改:

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

Copy link
Owner

为啥把默认规则删了呀🤔

Copy link
Contributor Author

jiadesen commented Apr 9, 2023

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

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

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /