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.

Mix-manifest always prefixed with public

See original GitHub issue

I am running this in a custom project outside of Laravel. I have tried multiple things but the manifest always creates paths with public prefixed:

{
  "public/js/app.js": "public/js/app.ee0ab4b45edac1e84a9d.js",
  "public/css/app.css": "public/css/app.e937875be4a33e00472a.css"
}

My mix file:

mix.js('resources/assets/js/app.js', 'public/js')
  .sass('resources/assets/sass/app.scss', 'public/css')
  .version();

In Laravel the mixfile looks exactly the same yet produces a mix-manifest without the public prefix. I have also looked at the mix() helper in Laravel what am I missing here?

Issue Analytics

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

github_iconTop GitHub Comments

5reactions
JeffreyWaycommented, Jan 31, 2017

For a stand-alone project, you need to tell Mix what your public base directory is. Do:

mix.js('resources/assets/js/app.js', 'public/js')
  .sass('resources/assets/sass/app.scss', 'public/css')
  .version()
  .setPublicPath('public');
3reactions
JeffreyWaycommented, Jan 31, 2017

The mix-manifest.json file should always be in your public directory.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Mix-manifest always prefixed with public · Issue #246
I am running this in a custom project outside of Laravel. I have tried multiple things but the manifest always creates paths with...
Read more >
Versioning with Mix, manifest does not exist. {but.... it does!)
I came across this thread as I faced the same issue. The problem a lot of the times is that the mix() -helper...
Read more >
The Mix manifest does not exist when it does exist
The mix() -helper function allows for a second argument, the directory of the manifest file. Just specify it there and it will use...
Read more >
Frequently Asked Questions | Laravel Mix Documentation
No. It has awareness of Laravel, but it can be used for any project. Just be sure to explicitly set the path to...
Read more >
Mix Manifest plugin
Provides twig function to read the manifest file generated by Laravel Mix Versioning.
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