Skip to content

Conversation

@chenjun1011
Copy link
Contributor

@chenjun1011 chenjun1011 commented Feb 12, 2020

遵循统一的构建产物规范 #187

调整 SSR 的构建产物

before:(依赖于 route 配置中的 name 值,对应函数名)

├── server
|  ├── about.js
|  └── index.js
└── web
   ├── pages_About_index.js
   └── pages_Home_index.js

after:(依赖于 route 配置中的 path 值)

MPA

├── node
|  ├── about
|  |  └── index.js
|  ├── index.js
└── web
   ├── about
   |  ├── index.html
   |  └── index.js
   ├── index.html
   └── index.js

SPA

├── node
|  ├── about
|  |  └── index.js
|  └── index.js
└── web
   ├── index.html
   ├── index.js
   ├── pages_about_index.chunk.js
   └── pages_home_index.chunk.js

同时:

  • 去掉了 SSR 下的 MPA 入口预览页,可直接按 routes 中 path 规则访问页面,无需独立路由页
  • 避免在 SSR 中维护 chunk 的构建规则,去掉了 SSR 下预加载 chunk 的能力

@yuanyan
Copy link
Contributor

yuanyan commented Feb 12, 2020

server 目录名 -> node/fc/now ?
fc、now、node.js 的构建产物目标是区别开的话,估计目录也是需要区别开

@chenjun1011
Copy link
Contributor Author

chenjun1011 commented Feb 12, 2020

server 目录名 -> node ?

可以的,从 端 的视角,叫 node 更合适

fc 和 now 是复用 node 的构建产物的

yuanyan
yuanyan previously approved these changes Feb 13, 2020
fyangstudio
fyangstudio previously approved these changes Feb 19, 2020
@chenjun1011 chenjun1011 dismissed stale reviews from fyangstudio and yuanyan February 19, 2020 07:23

The base branch was changed.

@chenjun1011 chenjun1011 changed the base branch from feat-update-mpa-url to master February 19, 2020 07:23
@chenjun1011 chenjun1011 merged commit 7c40ae2 into master Feb 19, 2020
@chenjun1011 chenjun1011 deleted the refactor-ssr-output branch February 19, 2020 07:36
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.

5 participants