Skip to content
New issue

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

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

Already on GitHub? # to your account

热更新失效 #3

Closed
transtone opened this issue Apr 29, 2022 · 6 comments
Closed

热更新失效 #3

transtone opened this issue Apr 29, 2022 · 6 comments

Comments

@transtone
Copy link

修改了值必须重新编译之后才能得到,没有了热更新。

@transtone transtone changed the title 热更新 热更新失效 Apr 29, 2022
@ItsRyanWu
Copy link
Contributor

ItsRyanWu commented Apr 29, 2022

谢谢反馈,因为平时并不经常用开发者工具里的“热重载”功能所以并没有在意到这个问题。

经调查发现该问题是由于微信开发者工具不支持监听由 @import 引用的 wxss 样式文件内容变动的 bug 引起的,并且通过官方社区查询该 bug 相关信息发现该 bug 在 2020 年时就已经存在

由于在小程序中使用 tailwind/windi css 的产物的最佳方式就是通过 @import 来引用一个单独的外部生成文件来做到样式文件的解耦,所以在官方有可能修复热重载功能之前该问题应该会一直存在,在此之前还是建议你关闭“热重载”而直接使用默认的全局重载。

@ItsRyanWu

This comment was marked as resolved.

@ItsRyanWu
Copy link
Contributor

@transtone 该 bug 已在微信开发者工具 Nightly 1.06.2205052 版本中修复
下载:http://dldir1.qq.com/WechatWebDev/test/cover/wechat_devtools_1.06.2205052_darwin_x64.dmg

@JIANGYUNPU
Copy link

@transtone 该 bug 已在微信开发者工具 Nightly 1.06.2205052 版本中修复
下载:http://dldir1.qq.com/WechatWebDev/test/cover/wechat_devtools_1.06.2205052_darwin_x64.dmg

https://github.com/JIANGYUNPU/csmpx 按官方文档操作还是一样的不生效,开发者工具已经最新的了1.06.2205172

@ItsRyanWu
Copy link
Contributor

ItsRyanWu commented May 26, 2022

@transtone 该 bug 已在微信开发者工具 Nightly 1.06.2205052 版本中修复
下载:http://dldir1.qq.com/WechatWebDev/test/cover/wechat_devtools_1.06.2205052_darwin_x64.dmg

https://github.com/JIANGYUNPU/csmpx 按官方文档操作还是一样的不生效,开发者工具已经最新的了1.06.2205172

具体是什么不生效?我下载了预览版 1.06.2205231 使用热重载是生效的,配合插件使用起来没有问题。
另外我发现你在组件内使用 Windi CSS 但并未在组件 JSON 配置中声明:

{
  "component": true,
  "styleIsolation": "apply-shared" // 声明 'apply-shared' 或 'shared'
}

https://github.com/JIANGYUNPU/csmpx/blob/master/src/components/list.mpx#L16
这会导致你的组件样式无法被 Tailwind/Windi CSS 生成的样式作用到。
关于这一点文档中有特别提醒,这是微信小程序对于组件样式的限制。
同类 issue: #1

@JIANGYUNPU
Copy link

@transtone 该 bug 已在微信开发者工具 Nightly 1.06.2205052 版本中修复
下载:http://dldir1.qq.com/WechatWebDev/test/cover/wechat_devtools_1.06.2205052_darwin_x64.dmg

https://github.com/JIANGYUNPU/csmpx 按官方文档操作还是一样的不生效,开发者工具已经最新的了1.06.2205172

具体是什么不生效?我下载了预览版 1.06.2205231 使用热重载是生效的,配合插件使用起来没有问题。 另外我发现你在组件内使用 Windi CSS 但并未在组件 JSON 配置中声明:

{
  "component": true,
  "styleIsolation": "apply-shared" // 声明 'apply-shared' 或 'shared'
}

https://github.com/JIANGYUNPU/csmpx/blob/master/src/components/list.mpx#L16 这会导致你的组件样式无法被 Tailwind/Windi CSS 生成的样式作用到。 关于这一点文档中有特别提醒,这是微信小程序对于组件样式的限制。 同类 issue: #1

不好意思不好意思,把这里拉下了。

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

3 participants