{{ mix('js/bundle.js') }} prepending "/" to path
See original GitHub issue- Laravel Mix Version: 0.12.1
- Node Version (
node -v
): 7.10.0 - NPM Version (
npm -v
): 4.2.0 - OS: Linux-mint
Description:
I use this to compile my vue component with HMR.
<script src="{{ mix('js/bundle.js') }}"></script>
It is normal when used with npm run hot
but when run npm run dev
is outputting
<script src="/js/bundle.js"></script>
I set the resource root like this
mix.setResourceRoot('/myapp/public/');
Because of the “/” the browser is looking for the file in the root directory of the server instead of “myapp”
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
{{ mix('js/bundle.js') }} prepending "/" to path #856 - GitHub
I use this to compile my vue component with HMR. <script src="{{ mix('js/bundle.js') }}"></script> It is normal when ...
Read more >Laravel Mix - Han Wiki
ALWAYS use mix('js/app.js') to refer to assets managed via Laravel Mix in HTML/Blade files e.g. <script src="{{ mix('js/bundle.js') }} ...
Read more >Hot Module Replacement | Laravel Mix Documentation
Hot Module Replacement (or Hot Reloading) allows you to, not just refresh the page when a piece of JavaScript is changed, but also...
Read more >Vite How can I bundle all Javascript files in a single file like ...
mix ? When I run Vite Build it creates a file for each component. That said, what is the correct config to avoid...
Read more >API - esbuild
The API can be accessed in one of three ways: on the command line, in JavaScript, and in Go. The concepts and parameters...
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
@ramakrishnamundru Workaround is using
url(mix())
helper as per Taylor Otwell’s suggestion.@ruchern And how does that resolve forcing leading slash behaviour?