[NervJS/taro] 微信小程序打包丢失app.wxss文件 (#5347)

From: notifications@github.com
Domain: IP info github.com
MX-server: IP info out-5.smtp.github.com
Size: 12112 Bytes
Create: 2020-01-16
Update: 2020-01-16
Score: 2
Safe: Yes

Outbound domains: user-images.githubusercontent.com | github.com |

问题描述

在App.js文件中引入字体的scss文件,在其他页面中不能正常使用。如果只在其他页面中单独引入,则能够正常显示。引入多次也会导致冲突

复现步骤

  1. 点击购物车
  2. 购物车中图标文件丢失
    app.jsx文件
import './assets/iconfont/myIconfont.scss';

myIconfont.scss文件

@font-face {font-family: "iconfont";
  src: url('./iconfont.eot?t=1579077716603'); /* IE9 */
  src: url('./iconfont.eot?t=1579077716603#iefix') format('embedded-opentype'), /* IE6-IE8 */
  url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAAcsAAsAAAAADcAAAAbeAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCEIAqNGIpiATYCJAMoCxYABCAFhG0HgQMbqwsjkg9SjuyfB7Zj6gyQCC47jKtuR2F6rqv83+WjqZocDfKf8yHc9N/lLkATxKpUaCdm2MRhZho2h81bnzg2UaH7RmGm9Lu3AQLmErf5wPn/4+/nonUgB/QLp+npL+7Vj/vRPuMRDXCAGzps/KO1rGxem3qQFO9+jwXWU8BhNNagMTHgAk3YUpFN0gEX61Dvuev1QAAIyFQbcVy69YECDMwkiJpix4+EIicCaxkiUHBlNccyZAt4KLhzYcDm8PfJNxqmAA48xTdyjms/BpY4ymclVUiGUAnS+hQA7I0ACqA2gNmcA7WqXWjMqB2yhLpEhlkAjLTqr2BxcR2DOtqxKdpls36mxbk1gVET6V88ORLAgwOFDAwKgMgQS4m2Je4EIA53AQgQ1wkgn7INILWz60AAHux2EIAD2wYBKNhFWAAZUN5hARhQPisFCgCA4CcaAVWAk0N8E/e2puDBaepVu7gA7m3JQpqJV6qU6YlKoqyhVOp4ncmgoeFUYiZ8PoEupJQtlgBpRwq3I+JQ341mDireVX2/wZoFRReq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zsfEZLlcbYoPj+IhSfjweg0Zb/PHj1mY1UnOTV43aVnVVp4M3lWmFibW3xC9CwIJfz6wiW6JXFQalfmo2ZR2pXXxJlye+THop5hkyi7dlZwXb3P/Z2SXTR8tihHKUWMK1tH5VfUJZonNm14GZSk+Z2cyeEvSRR0vP1ftt6T2Hf8EGe0vMlwCg4hpVDjtQcSNcauFfDwhbA7QfFwUqJHqEii20D/f11347mNL93wzXtP5NIf4UrHjm+KmPMlVIDHK3Ahxgk7/kZGEdm1FZLLBJZS7lv4Qz6R3P4nJEO++rrdPj1bo5iWLyvwknMQUc5MgAFApUxrC22oCHiMZABgXaAQG10PFkEQbMAgVh2QkAanobgND6AI7aNUBpfTGs7Qd4Sf5ARtscCPq1P6eoanZ3LJHVKIEPYAVlypHWuyj6hrpJWJmlhqMvLCtrhbBu/aL3ihmW6ziganVU1wpUSSlcjJthkhDkJTkUtWfqOj/49cbVHegJSic7diXE1P5sCXADoSWQjGpd25V+/gZpjQRTthSdEr6gUsWuHoQ8gQBzZWWiovuSWGlpkZoUCriZJZICF1KgRLsIyOu3cpBQ85gejtyBT82UlOVtn5Pe2tQfjhJ8TyGOUMIIT2REThQkgQhERMIMy7S0XtfaGQyjVUg0FYr1Bfmqb5RqxF0XuTAIwSqZJPR2o6npmhJ73aoMJxMA') format('woff2'),
  url('./iconfont.woff?t=1579077716603') format('woff'),
  url('./iconfont.ttf?t=1579077716603') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */
  url('./iconfont.svg?t=1579077716603#iconfont') format('svg'); /* iOS 4.1- */
}

.icon {
  font-family: "iconfont" !important;
  font-size: 16px;
  font-style: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.icon-shangdian:before {
  content: "\e600";
}

.icon-jianhao:before {
  content: "\e63f";
}

.icon-jiahao:before {
  content: "\e642";
}

.icon-faxian:before {
  content: "\e746";
}

.icon-xuanze:before {
  content: "\e62d";
}

.icon-shangcheng:before {
  content: "\e699";
}

.icon-lianxi:before {
  content: "\e611";
}

.icon-gouwuche:before {
  content: "\e772";
}

.icon-xuanze1:before {
  content: "\e613";
}

cart.js文件

 <AtIcon value='xuanze' prefixClass='icon' size='20' color='black'
                                    onClick={() => this.handleSelectAll(true)}/>

期望行为

在app.js引入后,其他所有页面都能正常使用

报错信息

截屏2020-01-16下午5 11 53

系统信息

👽 Taro v2.0.0-beta.13

Taro CLI 2.0.0-beta.13 environment info:
System:
OS: macOS 10.15.2
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 13.3.0 - /usr/local/bin/node
Yarn: 1.21.1 - /usr/local/bin/yarn
npm: 6.13.2 - /usr/local/bin/npm

补充信息

1、新建的项目直接把iconfont文件夹移动过去使用没问题。
2、项目图标是忽然显示不了的。
3、出问题的项目dist目录中,没有app.wxss,有vendors.wxxss。新项目相反,把vendors.wxss文件重命名为app.wxss问题解决
4、用全局样式的方法不能解决

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

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


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

Want to protect your real email from messages like this? Use TempM email and be more secure on the internet.