You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This discussion was converted from issue #15751 on May 20, 2024 05:57.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
重启项目就好了
目测原因:taro创建的小程序项目根目录的project.config.json文件没有默认设置compileHotReLoad属性,微信开发者工具勾选 启动代码自动热更新 会替换dist目录的编译的代码project.config.json的compileHotReLoad属性,而根目录的compileHotReLoad依旧无变化,这时候从新修改源码会重新编译替换dist下的内容,会导致之前设置的compileHotReLoad:true又改成false了。
为什么有些时候勾上 启动代码自动热更新 热重载第一次有效(盲猜,不确定):微信开发者工具监听dist文件夹下的内容,修改源码重新编译的时候,这时候会删除dist文件夹下的内容,可能先删除了非project.config.json之外的文件,这时候恰好微信开发者工具监听到了文件变化,读取了project.config.json文件配置(此时compileHotReLoad:true),这时候新的编译文件全部替换到了dist文件夹下
Beta Was this translation helpful? Give feedback.
All reactions