taro icon indicating copy to clipboard operation
taro copied to clipboard

Taro v2.2.3 #ifdef判断在微信小程序build模式下失效

Open divcss3 opened this issue 6 years ago • 2 comments

问题描述

#ifdef判断在微信小程序build模式下失效

复现步骤

  1. npx @tarojs/cli init myApp
  2. 在app.scss添加以下代码 image
  3. 执行npm run build:weapp
  4. 结果输出如图中右侧内容,npm run dev:weapp则正常
/*  #ifdef weapp  */
.weapp {
  color: red;
}
/*  #endif  */

/*  #ifdef h5  */
.h5 {
  color: pink;
}
/*  #endif  */


期望行为

报错信息

系统信息

👽 Taro v2.2.3

Taro CLI 2.2.3 environment info: System: OS: macOS 10.14.6 Shell: 5.3 - /bin/zsh Binaries: Node: 12.16.1 - /usr/local/bin/node npm: 6.13.4 - /usr/local/bin/npm npmPackages: @tarojs/cli: 2.2.3 => 2.2.3 @tarojs/components: 2.2.3 => 2.2.3 @tarojs/components-qa: 2.2.3 => 2.2.3 @tarojs/mini-runner: 2.2.3 => 2.2.3 @tarojs/mobx: 2.2.3 => 2.2.3 @tarojs/mobx-h5: 2.2.3 => 2.2.3 @tarojs/router: 2.2.3 => 2.2.3 @tarojs/taro: 2.2.3 => 2.2.3 @tarojs/taro-alipay: 2.2.3 => 2.2.3 @tarojs/taro-h5: 2.2.3 => 2.2.3 @tarojs/taro-qq: 2.2.3 => 2.2.3 @tarojs/taro-quickapp: 2.2.3 => 2.2.3 @tarojs/taro-swan: 2.2.3 => 2.2.3 @tarojs/taro-tt: 2.2.3 => 2.2.3 @tarojs/taro-weapp: 2.2.3 => 2.2.3 @tarojs/webpack-runner: 2.2.3 => 2.2.3 eslint-config-taro: 2.2.3 => 2.2.3 eslint-plugin-taro: 2.2.3 => 2.2.3 nerv-devtools: ^1.5.6 => 1.5.6 nervjs: ^1.5.6 => 1.5.6 stylelint-config-taro-rn: 2.2.3 => 2.2.3 stylelint-taro-rn: 2.2.3 => 2.2.3 taro-ui: ^2.2.4 => 2.2.4

补充信息

如果您有功能上的建议,可以提到 FeatHub

使用上的问题,欢迎在「Taro 社区」一起交流

divcss3 avatar May 06 '20 07:05 divcss3

CC @Chen-jj

taro-bot avatar May 06 '20 07:05 taro-bot

欢迎提交 Issue~

如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏

如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。

Good luck and happy coding~

taro-bot avatar May 06 '20 07:05 taro-bot