fix: hmr static server not response correct content-type #1307
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix the garbled text issue caused by the missing "charset=utf-8" in the Content-Type response header of JS files by the HMR static server.
Summary by CodeRabbit
mako
包的依赖版本,包括hyper-staticfile
、colored
和hyper
等。新增了一个名为hyper-staticfile-jsutf8
的依赖项。Test
,在app.tsx
文件中渲染两个<h1>
元素,一个展示“中文中文”,另一个展示“Hello World!”。devServer
对象中,特别是将devtool
、stats
和hash
设置移到devServer
中的host
和port
设置中。scripts/test-hmr.mjs
中JavaScript文件响应的内容类型检查问题,确保在热更新场景下匹配预期值。