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

import scss 图片文件 postcss-url 不生效 #3994

Closed
lonquan opened this issue Jul 28, 2019 · 5 comments
Closed

import scss 图片文件 postcss-url 不生效 #3994

lonquan opened this issue Jul 28, 2019 · 5 comments

Comments

@lonquan
Copy link

lonquan commented Jul 28, 2019

问题描述
import scss 图片文件 postcss-url 不生效

复现步骤

// app.scss
@import "scss/icon"

// icon.scss 
.icon {
  background-image: url("./../assets/images/icon/icon.png");
}

期望行为
静态资源进行 Base64 转换

报错信息

//compiled
.icon{
  background-image: url("./../assets/images/icon/icon.png"); }

系统信息

Taro v1.2 及以上版本已添加 taro info 命令,方便大家查看系统及依赖信息,运行该命令后将结果贴下面即可。

  Taro CLI 1.3.10 environment info:
    System:
      OS: macOS 10.14.2
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 11.5.0 - /usr/local/bin/node
      npm: 6.10.1 - /usr/local/bin/npm
    npmPackages:
      @tarojs/components: 1.3.10 => 1.3.10 
      @tarojs/plugin-babel: ^1.3.10 => 1.3.10 
      @tarojs/plugin-csso: 1.3.10 => 1.3.10 
      @tarojs/plugin-sass: 1.3.10 => 1.3.10 
      @tarojs/plugin-uglifyjs: 1.3.10 => 1.3.10 
      @tarojs/router: 1.3.10 => 1.3.10 
      @tarojs/taro: 1.3.10 => 1.3.10 
      @tarojs/taro-alipay: 1.3.10 => 1.3.10 
      @tarojs/taro-h5: 1.3.10 => 1.3.10 
      @tarojs/taro-qq: 1.3.10 => 1.3.10 
      @tarojs/taro-quickapp: 1.3.10 => 1.3.10 
      @tarojs/taro-swan: 1.3.10 => 1.3.10 
      @tarojs/taro-tt: 1.3.10 => 1.3.10 
      @tarojs/taro-weapp: ^1.3.10 => 1.3.10 
      @tarojs/webpack-runner: 1.3.10 => 1.3.10 
      eslint-config-taro: 1.3.10 => 1.3.10 
      eslint-plugin-taro: 1.3.10 => 1.3.10 
      nerv-devtools: ^1.4.0 => 1.4.3 
      nervjs: ^1.4.0 => 1.4.3 
      stylelint-config-taro-rn: 1.3.10 => 1.3.10 
      stylelint-taro-rn: 1.3.10 => 1.3.10 
@taro-bot
Copy link

taro-bot bot commented Jul 28, 2019

欢迎提交 Issue~

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

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

Good luck and happy coding~

@luckyadam
Copy link
Member

luckyadam commented Jul 29, 2019

@lonquan
Copy link
Author

lonquan commented Jul 29, 2019

可以确定的是不是因为图片过大导致的:
图片才 800b 大小, 并且直接写在 app.scss 是能正确被编码的

@luckyadam
Copy link
Member

没有复现,麻烦提供一个可以复现问题的 demo

@lonquan
Copy link
Author

lonquan commented Jul 29, 2019

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

3 participants