vuejs-templates/webpack

Relative static assets in CSS folder

Open

#932 opened on Sep 20, 2017

View on GitHub
 (8 comments) (10 reactions) (0 assignees)JavaScript (9,721 stars) (4,466 forks)batch import
help wantedneed repro

Description

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>

Contributor guide