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.

CSS url() Rewriting with subfolder

See original GitHub issue
  • Laravel Mix Version: 0.12.1
  • Node Version 8.0.0
  • NPM Version 5.0.0
  • OS: Win10 / Homestead-7

Description:

URL Processing is not working with subfolder.

Steps To Reproduce:

style.scss

body{
  background: url("../images/bg/bg1.png");
}

webpack.mix.js mix.sass('resources/assets/painel/sass/style.scss', 'public/css');

resources folder screenshot_26 20170605 09 22 17 screenshot_26 20170605 09 23 34

public folder screenshot_26 20170605 09 20 53

Result:

style.css

body {
  background: url(/images/bg1.png?810b1859b0d5c6f6273fb7818a633b03);
}

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10

github_iconTop GitHub Comments

2reactions
Romchikcommented, Jun 21, 2017

Sorry, I have no idea…

Maybe you can try to update npm to the last version. Tnen remove the ‘node_modules’ folder. Run npm cache clean. Run npm install.

2reactions
Romchikcommented, Jun 21, 2017

@marcelogarbin Fixed in 1.0.3. Path to image schould be started with "/images...": body { background: url("/images/bg/bg1.png"); }

Read more comments on GitHub >

github_iconTop Results From Across the Web

CSS url() Rewriting with subfolder · Issue #855 · laravel-mix ...
Question related: Laravel-mix appears to move files from my assets/img folder to public/images however when using the asset() helper function it ...
Read more >
URL rewrite in subfolder css not working - Stack Overflow
I think your error is just a reference problem. You can try ./css/style.css as this means it looks to find css as a...
Read more >
CSS URL References And URL Rewriting - Haacked
Partial URLs are interpreted relative to the source of the style sheet, not relative to the document. Thus, the correct CSS in my...
Read more >
URL rewrite subfolder to root and forbid accessing subfolder
I want all URLs starting with http://www.example.com/drupal being forbidden. This is .htaccess in / directory: Options -Indexes Options +FollowSymLinks < ...
Read more >
URL Rewriting Problem After Publishing Website in Sub Folder Of ...
it is working fine when i upload website at root domain of my website which is http://www.mywebsite.com but when i create virtual folder...
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