ice-lab / ice-next

The repo was transferred to https://github.com/alibaba/ice
https://v3.ice.work/
MIT License
53 stars 7 forks source link

Fix/dev server #503

Closed wssgcg1213 closed 2 years ago

wssgcg1213 commented 2 years ago

Solve the #335

  1. hds 热更新会给 entry 加入 hds/client/index.js 这一入口文件, 并在 resourceQuery 中加入 hostname, port 等参数
  2. 当启动多个 devServer 的时候,port 号会自动累加, 导致 entry 的 [name] 发生变化, 从而影响了 chunk hash 的结果
  3. 从而导致不同端口号有不同的 chunkFilename, 但是缓存目录 .ice 共享了同一个 assets-manifest.json, 导致访问的路径错乱
  4. 这里的解决思路是通过修改 chunkFilename 的形式让 weback-dev-server 的产出 chunk 不再在路径上带 hash
vercel[bot] commented 2 years ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
ice-v3 ✅ Ready (Inspect) Visit Preview Sep 5, 2022 at 5:36AM (UTC)
wssgcg1213 commented 2 years ago

先 Hold, 看另一个方案把 assets-manifest.json 放到内存里

ClarkXia commented 2 years ago

Fixed in https://github.com/ice-lab/ice-next/pull/534