使用webpack从相关路径加载CSS中的图像

时间:2018-02-12 18:55:01

标签: webpack sass webpacker

我有一棵树

app
  images
  stylesheets
    style.scss
other-app
  style.scss

// in other-app/style.scss
@import "./../app/stylesheets/style.scss"


// in app/stylesheets/styles.scss
...
  background: url('./../images/some-image.png');
...

webpack无法编译,因为它尝试解析other-app/../images/some-image.png。我尝试了像/ app / images / some-image.png这样的绝对路径,它编译但是在运行时无法找到资源。

有关我正在使用最新网络包的信息。

0 个答案:

没有答案
相关问题