Image references within Blade templates are not being recognized during build
See original GitHub issue- Laravel Mix Version: 1.2.3
- Node Version (
node -v
): 8.1.4 - NPM Version (
npm -v
): 5.0.3 - OS: OSX El Capitan
Description:
I have a fresh install of Laravel and within my blade templates I have references to an image like so:
<a class="navbar-brand" href="#"><img alt="Logo" src="{{ URL::asset('images/logo.png') }}"></a>
I have the image in:
resources
- assets
- images > logo.png
But when I run npm run watch
Or npm run dev
all other image references that I have within CSS and or in a .vue file get optimized and moved into
public
- images
except for the image I am pointing to within my blade template. Is there a way to get webpack to parse blade templates for any image references? Or is there a loader that is blade specific.
Or does this need to be a manual process of adding the image to the public directory myself? or to use mix.copy() to copy that directory when the build is run.
Thank you
Issue Analytics
- State:
- Created 6 years ago
- Reactions:4
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Image references within Blade templates are not being ...
Image references within Blade templates are not being recognized ... or to use mix.copy() to copy that directory when the build is run....
Read more >Image not showing in View (Laravel Blade file) - Stack Overflow
Image not showing in View (Laravel Blade file) ... in browser and by inspecting the page i have found that the URL it...
Read more >Blade Templates - Laravel - The PHP Framework For Web ...
Blade is the simple, yet powerful templating engine provided with Laravel. Unlike other popular PHP templating engines, Blade does not restrict you from...
Read more >Test and deploy Laravel applications with GitLab CI/CD and ...
To start, we create an Envoy.blade.php in the root of our app with a simple task to ... To be able to build,...
Read more >Common VM error codes in Azure - Virtual Machines
Each error object always contains an error code and a message. If the VM is created with a template, the error object also...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Right… I figured that much but was wondering if there was any plan on creating a blade-loader to check for file formats with .blade? Thanks guys!
I think @andrade1379 has a valid point. I am wondering the same thing. Clearly there will be many cases when a .css file will only be required in a particular .blade file. Right now, it doesn’t get processed by mix. Any plan of a ‘blade-loader’ to include scss and image files used in .blade templates?