Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

微信小程序无法热更新(已解决) #15751

Closed
lixy01 opened this issue May 18, 2024 · 0 comments
Closed

微信小程序无法热更新(已解决) #15751

lixy01 opened this issue May 18, 2024 · 0 comments

Comments

@lixy01
Copy link

lixy01 commented May 18, 2024

image image

重启项目就好了

目测原因: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文件夹下

@NervJS NervJS locked and limited conversation to collaborators May 20, 2024
@ZakaryCode ZakaryCode converted this issue into discussion #15755 May 20, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant