Skip to content
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

v0.6.0版本在使用时,运行unocss cli watch之后,会在.wxml顶部生成许多注释,导致页面展示出错 #55

Closed
SongYaoLynn opened this issue May 6, 2023 · 5 comments

Comments

@SongYaoLynn
Copy link

SongYaoLynn commented May 6, 2023

版本信息:
"devDependencies": {
"unocss": "^0.51.12",
"unocss-preset-weapp": "^0.6.0"
}

问题现象如下所示:
image

@SongYaoLynn SongYaoLynn changed the title In the v0.6.0 version, executing the unocss watch will cause a lot of redundant information to appear at the top of the .wxml file v0.6.0版本在使用时,运行unocss cli watch之后,会在.wxml顶部生成许多注释,导致页面展示出错 May 6, 2023
@MellowCo
Copy link
Owner

MellowCo commented May 6, 2023

你这是原生小程序使用 transformer 吗

@SongYaoLynn
Copy link
Author

我是在这个demo的基础上,将unocss-preset-weapp版本升级到^0.6.0,然后执行npm run unocss指令,在.wxml中就会出现截图所示的问题,.wxml中多了很多注释信息
demo:https://github.com/MellowCo/unocss-wechat

@MellowCo
Copy link
Owner

MellowCo commented May 6, 2023

这个是给 unocss vscode 插件,做class位置匹配用的,因为原生小程序使用 transformer 会改变原文件,所以展示出来了 QAQ

@SongYaoLynn
Copy link
Author

这个是给 unocss vscode 插件,做class位置匹配用的,因为原生小程序使用 transformer 会改变原文件,所以展示出来了 QAQ

wow~我尝试降级unocss-preset-weapp到v0.5.3就不会复现问题了,这是0.6.0版本新引入的问题吗?

@MellowCo
Copy link
Owner

MellowCo commented May 6, 2023

  • 升级到 0.6.1
"unocss-preset-weapp": "^0.6.1"
  • 添加 classTags: false
transformers: [
  transformerClass({
    include,
    classTags: false
  })
]

@MellowCo MellowCo closed this as completed May 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants