We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
微信小程序
小程序基础库: 2.12.1 使用框架: React
npm run dev:weapp
.login { position: relative; @include display-flex; @include align-items(center); padding: r(30) r(15) r(10); /* #ifdef h5 */ font-size: 40px; /* #endif */ }
如图:
npm run build:weapp
npm run build:weapp 后,专属 h5环境的样式剔除
没有剔除 h5环境的代码
Taro CLI 3.0.7 environment info: System: OS: macOS 10.14.5 Shell: 3.2.57 - /bin/bash Binaries: Node: 12.16.1 - /usr/local/bin/node Yarn: 1.19.1 - /usr/local/bin/yarn npm: 6.13.4 - /usr/local/bin/npm npmPackages: @tarojs/components: 3.0.7 => 3.0.7 @tarojs/mini-runner: 3.0.7 => 3.0.7 @tarojs/react: 3.0.7 => 3.0.7 @tarojs/runtime: 3.0.7 => 3.0.7 @tarojs/taro: 3.0.7 => 3.0.7 @tarojs/webpack-runner: 3.0.7 => 3.0.7 babel-preset-taro: 3.0.7 => 3.0.7 eslint-config-taro: 3.0.7 => 3.0.7 nervjs: ^1.5.7 => 1.5.7 react: 16.8.2 => 16.8.2 taro-ui: ^3.0.0-alpha.3 => 3.0.0-alpha.3 npmGlobalPackages: typescript: 3.1.1
The text was updated successfully, but these errors were encountered:
3.x似乎没有css按条件编译了
Sorry, something went wrong.
那该怎么弄处理呢?请指教下?
3.x似乎没有css按条件编译了 那该怎么弄处理呢?请指教下?
大概这样可以实现
// index.js import './index.css';
// index.h5.js import './index.h5.css';
然后在需要的地方引入js
fix(runner): 修复样式条件编译问题,close #7410
98c1524
fix(runner): 修复样式条件编译问题,close #7410 (#7450)
bcf5a0c
luckyadam
Successfully merging a pull request may close this issue.
相关平台
微信小程序
小程序基础库: 2.12.1
使用框架: React
复现步骤
npm run dev:weapp
在样式表里使用条件指令,有效如图:
npm run build:weapp
后指令无效、无效 ,如图:期望结果
npm run build:weapp
后,专属 h5环境的样式剔除实际结果
没有剔除 h5环境的代码
环境信息
The text was updated successfully, but these errors were encountered: