Closed tianbaolin closed 3 months ago
通过npx ssr build --html命令,进行html 文件部署,所有的CSS文件都在首页加载了。构建输出的HTML文件把style样式全部插进来了。这儿是没考虑CSS的按需加载吗?正常SSR构建是没问题的。 `
<link rel="stylesheet" href="./client/static/orderDetail~cashierDesk.a12f87e9.chunk.css" /> <link rel="stylesheet" href="./client/static/shoppingCart~menuQR.a1d51852.chunk.css" /> <link rel="stylesheet" href="./client/static/404.9a41b8bc.chunk.css" /> <link rel="stylesheet" href="./client/static/appHub.30a483fa.chunk.css" /> <link rel="stylesheet" href="./client/static/cashierDesk.926db1ed.chunk.css" /> <link rel="stylesheet" href="./client/static/closingPage.891296ea.chunk.css" /> <link rel="stylesheet" href="./client/static/googleMap.8627938f.chunk.css" /> <link rel="stylesheet" href="./client/static/instruction.9905616a.chunk.css" /> <link rel="stylesheet" href="./client/static/loginProtocol.283b79c1.chunk.css" /> <link rel="stylesheet" href="./client/static/menuProtocol.a7d9d351.chunk.css" /> <link rel="stylesheet" href="./client/static/menuQR.506a669b.chunk.css" /> <link rel="stylesheet" href="./client/static/merchantHome.9531eb3e.chunk.css" /> <link rel="stylesheet" href="./client/static/myOrders.d07fcf50.chunk.css" /> <link rel="stylesheet" href="./client/static/orderDetail.4b654fcc.chunk.css" /> <link rel="stylesheet" href="./client/static/pay.abf94d1a.chunk.css" /> <link rel="stylesheet" href="./client/static/qponHomePage.20cc380c.chunk.css" /> <link rel="stylesheet" href="./client/static/shoppingCart.b63d5f4a.chunk.css" /> <link rel="stylesheet" href="./client/static/37.96b148f4.chunk.css" /> <link rel="stylesheet" href="./client/static/38.aecd7917.chunk.css" /> <link rel="stylesheet" href="./client/static/39.b63d5f4a.chunk.css" /> <link rel="stylesheet" href="./client/static/40.1b342779.chunk.css" /> <link rel="stylesheet" href="./client/static/41.116cb1c1.chunk.css" />
`
css按需加载依赖服务端的动态逻辑,目前考虑到html方案不是主流方案为降级场景才会使用没有实现按需加载
ssr@6.2.76 更新了一下这里的逻辑,可以尝试升级一下看看会不会有样式闪烁的问题
通过npx ssr build --html命令,进行html 文件部署,所有的CSS文件都在首页加载了。构建输出的HTML文件把style样式全部插进来了。这儿是没考虑CSS的按需加载吗?正常SSR构建是没问题的。 `
`