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.

Wrong laravel mix rewrite url path when place project in subfolder

See original GitHub issue

I did install my laravel project on http://localhost/laravel and I run this project in browser at http://localhost/laravel/public

current url path on compiled scss files is font/vendor/something, can laravel mix replace url path with relative path base on compiled scss like ../fonts/vendor/something?

I knew if I run my project with php artisan serve it won’t be a problem, what if I install my project in subfolder?

untitled

Issue Analytics

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

github_iconTop GitHub Comments

56reactions
gbelisariocommented, Feb 27, 2018

I solved this problem using this:

{{ url(mix('/all.min.css')) }}

26reactions
ha5ilcommented, Jun 3, 2020

I added 'mix_url' => env('APP_URL', 'http://localhost'), on config/app.php and also set the APP_URL on env as per subfolder to solve this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Wrong laravel mix rewrite url path when place project in ...
I added 'mix_url' => env('APP_URL', 'http://localhost'), on config/app.php and also set the APP_URL on env as per subfolder to solve this.
Read more >
Wrong laravel mix rewrite url path when place project in ...
After a few struggle, I am able to resolve the issue, I have done the following changes. In .env added. APP_URL=http://localhost:8000 ...
Read more >
CSS URL Rewriting | Laravel Mix Documentation
One key concept to understand is that Mix and webpack will rewrite any url() s within your stylesheets. While this might initially sound...
Read more >
Compiling Assets (Laravel Mix)
Laravel Mix provides a fluent API for defining Webpack build steps for your ... Absolute paths for any given url() will be excluded...
Read more >
Laravel 8 Images Path Not Working In Sub-Directory And ...
One key concept to understand is that Mix and webpack will rewrite any url s within dist/images folder and then rewrite the url...
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