question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

after build find background url path is wrong

See original GitHub issue

This is my project struct |------src |------|------assets |------|------|------bg.jpg |------|------views |------|------|------index.vue |------|------app.vue |------|------main.js

i write css in index.vue

body{ background: url(‘…/assets/bg.jpg’) no-repeat; background-size: cover; font-size: 62.5%; }

After i run “npm run build” i find dist folder struct like this |------dist |------|------static |------|------|------bg.jpg |------|------|------app.xxx.js |------|------|------app.xxx.css |------|------index.html

but in app.xxx.css i find the bg.jpg’s path is background:url(./static/bg.jpg?1b5ca27) i think it is wrong. how can i to fixed it?

And all build option i used default setting

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
yyx990803commented, Apr 19, 2016

It seems you are using a relative publicPath. publicPath should be a root-relative path like /static instead of ./static.

0reactions
cloudshadowcommented, Apr 19, 2016

@yyx990803 work for me! thanks a lot

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix CSS background-image not working | HTML/CSS
2. Make sure the image path is set correctly in the background-image url. Once you have made sure that your CSS file is...
Read more >
CSS Background-Image Path Issues - Stack Overflow
I would use Firebug's "Inspect Element" function to find out whether there is another background setting taking precedence. URLs with spaces ...
Read more >
Background images not working because of wrong path ...
I'm having the same trouble. We upgraded to 4.5.5 today and the URL path on CSS referenced background images started throwing 404 errors....
Read more >
Forums - CSS - [Solved] Background Image Not Showing
1) The file name is EXACTLY right. · 2) The file path is EXACTLY right. This file path presupposes that the image folder...
Read more >
I cannot create relative path links - CSS - Codecademy Forums
How do I get these to go away or at least show me what is wrong. ... would be url("your\\path\\here\\Resources\\images\\background.jpeg") ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found