vuejs-templates/webpack

Relative static assets in CSS folder

Open

#932 建立於 2017年9月20日

在 GitHub 查看
 (8 留言) (10 反應) (0 負責人)JavaScript (9,721 star) (4,466 fork)batch import
help wantedneed repro

描述

Just opening a new issue confirming that bug #208 still exists and @githoniel's solution is still necessary today.

This has all to do with using relative paths in CSS files.

<style>
  .element {
    background-image: url('~./assets/img/bg.png');
    // works in dev
    // in production, browser will try to retrieve /static/css/assets/img/bg.png
  }
</style>

貢獻者指南

Relative static assets in CSS folder · vuejs-templates/webpack#932 | Good First Issue