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

Taro@4 vite 模板中,对 mini 的默认配置错误地开启了 htmltransform #16710

Open
j10ccc opened this issue Oct 14, 2024 · 0 comments
Labels
F-react Framework - React T-weapp Target - 编译到微信小程序 V-4 Version - 4.x

Comments

@j10ccc
Copy link

j10ccc commented Oct 14, 2024

相关平台

微信小程序

小程序基础库: 2.0.0
使用框架: React

复现步骤

用 Taro@4 vite 模板,写一段 css,观察 css 的构建产物

input {
  color: red;
}

期望结果

正常构建对 input 选择器的样式

实际结果

在构建产物中发现 input 选择器被构建成了 .h5-input

环境信息

👽 Taro v4.0.6


  Taro CLI 4.0.6 environment info:
    System:
      OS: macOS 14.2.1
      Shell: 3.7.1 - /opt/homebrew/bin/fish
    Binaries:
      Node: 18.19.0 - ~/.nvm/versions/node/v18.19.0/bin/node
      Yarn: 1.22.19 - ~/Library/pnpm/yarn
      npm: 10.2.3 - ~/.nvm/versions/node/v18.19.0/bin/npm
    npmPackages:
      @tarojs/cli: 4.0.6 => 4.0.6 
      @tarojs/components: 4.0.6 => 4.0.6 
      @tarojs/helper: 4.0.6 => 4.0.6 
      @tarojs/plugin-framework-vue3: 4.0.6 => 4.0.6 
      @tarojs/plugin-platform-weapp: 4.0.6 => 4.0.6 
      @tarojs/runtime: 4.0.6 => 4.0.6 
      @tarojs/shared: 4.0.6 => 4.0.6 
      @tarojs/taro: 4.0.6 => 4.0.6 
      @tarojs/vite-runner: 4.0.6 => 4.0.6 
      babel-preset-taro: 4.0.6 => 4.0.6 

补充信息

看了 taro-vite-runner 的代码,模板中写 htmltransform 的就是开启的,貌似没有对 mini 做关闭的声明。实际测试在手动关闭 htmltransform 后产物正常了

https://github.com/NervJS/taro/blob/main/packages/taro-vite-runner/src/defaultConfig/defaultConfig.mini.ts#L41-L42

@TheKonka TheKonka added F-react Framework - React T-weapp Target - 编译到微信小程序 V-4 Version - 4.x labels Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-react Framework - React T-weapp Target - 编译到微信小程序 V-4 Version - 4.x
Projects
Status: Todo
Development

No branches or pull requests

2 participants