-
Notifications
You must be signed in to change notification settings - Fork 11.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added support for multiple manifest files #19764
Added support for multiple manifest files #19764
Conversation
Actually for me this code can't work at all! ^^" @taylorotwell I really think we shouldn't accept code which is not tested. I've fixed it in #19895 but we should also fix it in 5.4... |
@mathieutu I can't see the issue here? It checks to see if the manifestKey is cached and if it is gets the current cached value and assigns it to a variable. Otherwise, it then puts the manifestKey into the cache. Is this not the intended behaviour? It seems right to me. |
Is this broken or not? Getting weary of these Mix changes. |
I think it's strange that people want multiple mix-manifest.json files in the first place. What's the use case here? |
@JeffreyWay If I remember correctly some people wanted to generate multiple files within mix. For example one for the application and one for specific pages and maybe one for vendor resources. |
I agree with @mathieutu, the caching part can't work now. |
if (file_exists(public_path($manifestDirectory.'/hot'))) { | ||
return new HtmlString("//localhost:8080{$path}"); | ||
} | ||
|
||
if (! $manifest) { | ||
if (in_array($manifestKey, $manifests)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be array_key_exists($manifestKey, $manifests)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah of course, it's why I've seen this can't work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, my bad
@georgehanson @taylorotwell If you look at the code, you will directly see that this can't work. The mix method will continue to work globally, but it will no longer have a cache system. Testing guy, testing!! I'll do a PR to fix that if @taylorotwell really doesn't want to merge my PR of global mix refactoring in 5.4... PS1: I don't use multiple file either, but this is in the code, and asked for by some people in comments, so... |
@bobbybouwmann the manifest file is just meant to list all the artifacts of the build, all of the resources should be in there, not separating them into their own manifest files. |
@JeffreyWay @bobbybouwmann @joshmanders @mathieutu
|
Separate js output files and vendor extraction shouldn't require separate manifests. That's a very common case. |
@devcircus It were some issues with an es6 librarie, so I had to disable uglify for the admin code. |
Currently if you try to use two different manifest files, only the first one is cached and the second one breaks.
This code caches all of the manifest files, to allow all of them to be used together.